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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class not found error

Status
Not open for further replies.

darine

Programmer
Jun 23, 2000
28
0
0
US
Hi All <br>i have this simple class in c:\mydir <br>class moh<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;public static void main(String arg[])<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br> System.out.print(&quot;Hello from &quot;);<br> se&nbsp;&nbsp;s = new&nbsp;&nbsp;se();<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br><br>Also i have this se class in the same directory(c:\mydir )<br>public class se<br>{<br> se()<br> {<br> System.out.println(&quot;this a se class &quot;);<br> }<br>}<br><br>I compiled both and so i got two classes moh.class and se.class in c:\mydir<br>what happened i moved se.class to directory c:\<br>and i tried to set path in autoexe.bat as :<br>&nbsp;SET CLASSPATH=%CLASSPATH%;.;c:\se.class and i restart my computer.<br>i tried to run moh class from c:\mydir i got a error message as:<br>&nbsp;class not found:se.<br>please help with it.<br>i will appreciate your help.
 
In the CLASSPATH variable you specify directories to search, not the specfic files. Try setting the CLASSPATH to search c:\ instead of c:\se.class<br><br> <p>Troy<br><a href=mailto:fenris@hotmail.com>fenris@hotmail.com</a><br><a href= > </a><br>
 
Thanks alot Fenris ,it is working now.<br>thanks
 
What I usually do is I have a seperate directory that I use for that sort of thing. I call it c:\java\lib&nbsp;&nbsp;.I store packages and classes in here. The nice thing about this is that you don't have to change the CLASSPATH all the time. You just have to set it up once :)<br><br><br> <p>Troy<br><a href=mailto:fenris@hotmail.com>fenris@hotmail.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top