Error: Could not find or load main class com.sun.tools.javac.Main
918595Feb 20 2012 — edited Nov 9 2012Hi Everybody,
I'm using Windows 7 command prompt. I tried to do javac and I'm getting an error that says: Error: Could not find or load main class com.sun.tools.javac.Main.
I downloaded the JDK 7u3 and saved it to the following directory C:\users\joshuafinch\Java. Afterwards I set the PATH and CLASSPATH in the system environment variables.
The PATH was set to C:\users\joshuafinch\Java\jdk1.7.0_03\bin.
The CLASSPATH was set to C:\users\myusername\Java\jdk1.7.0_03\lib.
When I type the javac command in the following directory: C:\users\joshuafinch\Java\bin> I get the above error.
When I type java or java -version it indicates that it is working properly. It's just that when I type in javac or javac -version I get the error that was mentioned above. I'm using Notepad as a text editor. I saved the notebook file as a .java file and made sure I selected all files, plus, actually saved the file in the bin directory. I was trying to run a simple HelloWorld.java file. This problem is driving me crazy. I've been trouble shooting it off and on for the last 24 hours. Any help will be greatly appreciated.
Thanks. Josh