问题
i am trying to use node-java package.i need to run small java code from node.js.first i run command
npm install java
after that i cloned source code of this library.(https://github.com/joeferner/node-java) i went to node-java directory using
cd node-java
then run command ./compile-java-code.sh and getting error
Fatal Error: Unable to find package java.lang in classpath or bootclasspath
i am using ubuntu 12.04 64 bit. when i run command
java -version
its returning
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~precise1)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
and when i run command javac -version
its returning
javac 1.7.0_75
perhaps its require some additional environment configuration.How to handle this issue.Please guideline.
回答1:
Checking the script to compile node-java I see the setting for bootclasspath there:
-bootclasspath /opt/jdk/jre/lib/rt.jar
Do you have this jar file /opt/jdk/jre/lib/rt.jar
? If not, then you may want to adjust the script to point to your JRE location.
来源:https://stackoverflow.com/questions/28944890/fatal-error-unable-to-find-package-java-lang-in-classpath-or-bootclasspath