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!

Helppppp whats this????

Status
Not open for further replies.

Nandito

Programmer
Apr 12, 2000
31
0
0
AU
Visit site
C:\JavaTech&gt;java mainIt<br>Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: mainIt<br><br>Why does it do that to all my compile files????<br>please any1???<br>If it is the autoexec.bat then...could you tell me how to setup the classpaths but i doubt is that.. :(
 
You check the name of your class and name of your file should be same.<br>Also check for the path.If you are writing two classes then give the name for the file same as the name of the class in which you have written the main.<br>I hope your problem will solve now<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bye Remo(Programmer)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
You compiled your file first, right? And what directory are you running java in- the same directory as your class file?<br><br>Usually, the capitalization rules for Java are to capitalize the first letter of a class... your comiler will then generate a class file with a capitalized first letter. The java arguments are class sensitive. That could be it. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
<br>Please check your CLASSPATH environmental variable;<br>It should contain you local directory where your compiled program (ie xxxx.class) resides<br><br>Eg: If your compiled program is in \javacodes<br><br>CLASSPATH should contain \javacodes<br>
 
Hai,<br>&nbsp;I think this pbm is caused by there is no mainIt.class .You know that java is a case-sensitive language.Another 2 reasons are raised for this exception.<br><br>1. mainIt.java may be extended by java.applet.Applet API or JApplet API.<br>2. You didn't give a valid main method (Like public static void main(String ads[])&nbsp;&nbsp;)<br><br>From this exception, we know that classpath was set to that folder.<br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top