Compiler Error - 'Error: Could not find or load main class com.sun.tools.javac.Main'

前端 未结 7 2066
眼角桃花
眼角桃花 2020-12-16 16:03

I just started learning Java and I installed JDK on my computer, but now I am trying the SIMPLIST of Java and its not compiling. I installed JDK on C:/Java/jdk7/

7条回答
  •  既然无缘
    2020-12-16 16:48

    Did you reboot after you installed? There are some important environment variables (namely the CLASSPATH) that aren't set until you reboot Windows. Anyway, you can work around it by adding rt.jar and tools.jar to your CLASSPATH. Also, you should probably make sure your JAVA_HOME is set.

提交回复
热议问题