Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

918595Feb 20 2012 — edited Nov 9 2012
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2012
Added on Feb 20 2012
18 comments
40,583 views