Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有行'sun.tools.jmap.JMap.main(args);' 在我的代码中。Eclipse 给出错误,说类没有被识别。所以,我尝试下载 sun.tools jar。但我在任何地方都找不到这个罐子!
我不确定要包含什么来消除此错误。请帮忙!
该类sun.tools.jmap.JMap不是标准 JRE 的一部分。这由 JDK 附带的开箱即用工具使用。
sun.tools.jmap.JMap
班级sun.tools.jmap.JMap在<JAVA_HOME>/lib/tools.jar. 此文件夹中的罐子由文件夹中的工具使用<JAVA_HOME>/bin。例如, sun.tools.jmap.JMap被工具使用jmap.exe
<JAVA_HOME>/lib/tools.jar
<JAVA_HOME>/bin
jmap.exe
要在 Eclipse 中编译代码,请将其包含<JAVA_HOME>/lib/tools.jar在类路径中。