简体   繁体   中英

com.sun.tools.javac.Main is not on the classpath

Unable to find a javac compiler; 环境变量设定

com.sun.tools.javac.Main is not on the classpath.

Perhaps JAVA_HOME does not point to the JDK.

It is currently set to C:\\Program Files\\Java\\jre1.8.0_111

I'm getting this error when i try to run CMD file. 日食设置

You need to install JDK

In ECLIPSE, Set the installed JRE setting to the JDK - in the project (project properties -> Java Build Path-> Libraries), or global default in preferences (Java->Installed JREs). The eclipse setting is stronger than the system variable

it is points to SE1.8

Try this also:

  • Eclipse, access the menu: "Window -> Preferences"
  • Go to "Ant -> Runtime", at the tree;
  • Go tothe Classpath tab;
  • Go to and Expand the "Global Entries" item;
  • In Global Entries, the path to tools.jar was wrong. It was pointing to an older version of Java;
  • removed the wrong entry and added the correct one with "Add External Jars" button.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM