node-java icon indicating copy to clipboard operation
node-java copied to clipboard

Is there a way to find JAVA_HOME and set include libraries at runtime?

Open doozi316 opened this issue 2 years ago • 0 comments

Hi, Is there a way to find JAVA_HOME and set include libraries at runtime?

I understand that in Binding.gyp it finds the JAVA_HOME of the build environment and builds the jvm and Java's libraries. And I found that the library built with it is used as #include in the c++ file. I noticed that in postInstall.js the JAVA_HOME path of the build environment is created in jvm_dll_path.json .

Even if the user's environment does not have the same version of JAVA as the build environment, I want the program to run as long as there is a different version of JAVA. In the case of jvm_dll_path.json, I was able to somehow obtain the JAVA_HOME of the user environment by referring to issue #378, I don't know how to dynamically modify Java-related libraries built with node-gyp included in the nodejabridge_bindings.node binary module.

I don't know much about c++. If you know a good way related to this, please reply. Thank you

doozi316 avatar Aug 24 '23 07:08 doozi316