致命错误:无法在classpath或bootclasspath中找到包java.lang [英] Fatal Error: Unable to find package java.lang in classpath or bootclasspath

查看:183
本文介绍了致命错误:无法在classpath或bootclasspath中找到包java.lang的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用node-java package.i需要从node.js.first运行小的java代码我运行命令

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

之后我克隆了这个库的源代码。( https://github.com/joeferner/node-java
i转到node-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

然后运行命令./compile-java-code.sh并获取错误

then run command ./compile-java-code.sh and getting error

致命错误:无法在类路径中找到包java.lang或bootclasspath

Fatal Error: Unable to find package java.lang in classpath or bootclasspath

我使用的是64位的ubuntu 12.04。当我运行命令时

i am using ubuntu 12.04 64 bit. when i run command

java -version 

返回

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)

当我运行命令 javac -version 时它返回

javac 1.7.0_75

或许需要一些额外的环境配置。如何处理这个问题。请指导。

perhaps its require some additional environment configuration.How to handle this issue.Please guideline.

推荐答案

检查脚本编译node-java我看到的设置为bootclasspath那里:
-bootclasspath /opt/jdk/jre/lib/rt.jar

Checking the script to compile node-java I see the setting for bootclasspath there: -bootclasspath /opt/jdk/jre/lib/rt.jar

你有这个jar文件 /opt/jdk/jre/lib/rt.jar ?如果没有,那么您可能需要调整脚本以指向您的JRE位置。

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.

这篇关于致命错误:无法在classpath或bootclasspath中找到包java.lang的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆