nvuillam / node-java-caller

Lightweight cross-platform javascript module to easily call java from node sources. Automatically install java if not present
MIT License
39 stars 10 forks source link

Java spawn error ENOENT inside Docker #28

Open ainuraliyah opened 1 year ago

ainuraliyah commented 1 year ago

Hi, I would like to ask about using java-caller. I deployed my app into a Docker container (OS Linux), and the jdk/jre required is successfully installed inside the container. However, it shows a spawn error as mentioned below:

Java jre or jdk 11 is required
Installing Java jre 11 in /home/support/.java-caller...
Installed Java jre 11 in /home/support/.java-caller/jre...
Java spawn error: Error: spawn java ENOENT

My node.js code implementing javaCaller is depicted here:

const java = new JavaCaller({
              jar: 'myRunnableJar.jar',
              minimumJavaVersion: 11,
              maximumJavaVersion: 11
});

const {stdout, stderr} = await java.run([`--myArgs myValue`]);

I wonder if someone experienced the same issue, any favor and solutions will be appreciated, thank you!

nvuillam commented 3 weeks ago

@ainuraliyah i just release https://github.com/nvuillam/node-java-caller/releases/tag/v4.1.0 , do you still have the issue ?