Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java can't find my class 3

Status
Not open for further replies.

rabit

Programmer
Oct 14, 1998
1
0
0
US
When I run java at the command line, (ie. C:\java myclass) java returned an error that it could not find my class.<br>
<br>
I verified that the CLASSPATH contains the path to my class directory.<br>
<br>
It also happened on both of my computer, one's running Windows NT, one's running Windows 98.<br>
<br>
Both machines are cleaned with Visual Cafe 2.5 as the only Java IDE.<br>
<br>
Please help. Thanks
 
There are a couple of things to check:<br>
<br>
1) Java is case sensitive, is 'myclass' the name of the class or is it MyClass?<br>
<br>
2) You indicate that 'myclass' is in your class path. Does it have a package name: package mypackage; If so, your command line should be 'java mypackage.myclass'?<br>
<br>
3) Lastly, if the only java you have installed is Visual Cafe, older versions used to use the classpath setup in their INI file (I don't know if that is still the case). Make certain that classpath is correct.
 
You might add the . ( current directory ) to your CLASS_PATH variable , because if it is a new compiled class then it will be in your current dir.
 
You might add the . ( current directory ) to your CLASS_PATH variable , because if it is a new compiled class then it will be in your current dir.
 
Another common gotcha is that the jvm usually gives this message when a dependent class is not in the CLASSPATH. Example: x extends y. You are trying to load x, but y is not available. The jvm will say x is not found....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top