Domanda

I have the line 'sun.tools.jmap.JMap.main(args);' in my code. Eclipse is giving error saying the class is not identified. So, I tried to download sun.tools jar. But I could not find this jar anywhere!

I am not sure what to include to remove this error. Please help!

È stato utile?

Soluzione

The class sun.tools.jmap.JMap is not part of standard JRE. This is used by the out of box tools shipped with JDK.

The class sun.tools.jmap.JMap is in <JAVA_HOME>/lib/tools.jar. Jars in this folder are used by the tools in <JAVA_HOME>/bin folder. For example, sun.tools.jmap.JMap is used by a tool jmap.exe

For your code to compile in Eclipse, include <JAVA_HOME>/lib/tools.jar in the classpath.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top