Groups
Groups
Sign in
Groups
Groups
nodejs
Conversations
About
Send feedback
Help
How to write a node module in Java
58 views
Skip to first unread message
Reza Razavipour
unread,
Aug 4, 2017, 2:13:48 AM
8/4/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nodejs
I know node can make Java calls.
What I want to do is the reverse. I want to make my Java code into a node module.
Is that possible? If so, how? If not, why?
Xinyong Wang
unread,
Aug 7, 2017, 5:56:11 PM
8/7/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nodejs
maybe you can use JNI as a bridge
Xinyong Wang
unread,
Aug 7, 2017, 10:05:01 PM
8/7/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nodejs
It is possible.
1. You can wrapper the java calls to a separate process, and run it in a subprocess, use stdin/stdout for communication.
OR
2. use JNI, you can implement a native module for nodejs, and call java method in the native module via JNI.
On Friday, August 4, 2017 at 2:13:48 PM UTC+8, Reza Razavipour wrote:
Reply all
Reply to author
Forward
0 new messages