How can I call a nodejs method in Java code?

Asked

Viewed 168 times

0

I need to use a Node method in a Java application.

I can’t use Nashorn because I need Jquery since pure JS doesn’t solve my problem. Since Node allows the use of Jquery, it was chosen, but I cannot do the integration.

Is it possible? If so, how?

  • I may be talking nonsense, because I don’t know very well about Node, but can’t run a command using Runtime and the java Process by passing the name of the file? Type, Process exec = Runtime.getRuntime(). exec("Node command.js");

  • @Paulogustavo I thought this solution yesterday, but it’s a half ugly solution :P no? I thought I could have some clean form for integration, anyway thank you, I’ll do it this way even.... I’ll do it using the Linux run Linux.run(diretorio, "node mynode.js"); and play the answer in a file

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.