Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Exception in thread "main" java.lang.NoClassDefFoundError: MyApp

hi all,

I'm getting the mentioned error while trying to run my app. I'm using TextPad to compile and run my app. i have also try to run from command prompt but it shows same error. I have checked my jdk bin dir and jre bin dir. Both of them are the correct path. where did I go wrong?

rgds,
jpdbay
[329 byte] By [jpdbay] at [2007-11-11 8:29:46]
# 1 Re: Exception in thread "main" java.lang.NoClassDefFoundError: MyApp
Silly question, but do you have a main class?

Have you tried explicitly putting the classpath when running from the command prompt?
masher at 2007-11-11 22:35:12 >
# 2 Re: Exception in thread "main" java.lang.NoClassDefFoundError: MyApp
of coz I hv main class and tried explicitly to run but still I'm getting same error.
jpdbay at 2007-11-11 22:36:12 >
# 3 Re: Exception in thread "main" java.lang.NoClassDefFoundError: MyApp
This is what I was looking for.

http://forum.java.sun.com/thread.jspa?threadID=571464&start=15&tstart=0

This helped when I was getting the same error.
masher at 2007-11-11 22:37:16 >
# 4 Re: Exception in thread "main" java.lang.NoClassDefFoundError: MyApp
Just curios but have you been able to fix this problem?
javatier at 2007-11-11 22:38:21 >
# 5 Re: Exception in thread "main" java.lang.NoClassDefFoundError: MyApp
I think your custom enviroment varibales are messed up. Do a search on how to set your CLASSPATH in the enviroment variable.
major at 2007-11-11 22:39:20 >
# 6 Re: Exception in thread "main" java.lang.NoClassDefFoundError: MyApp
hello friend,

this problem "class not found " boz of u save your class in this folder you run in same folder,or in your classpath u not use ". ",
for example set your classpath like this:
c:\rahul>set classpath=%classpath%;.
see i wrote " ." in the end of classpath.
"." means current folder included that means classes are also find in current folder.
--diwakar
diwakar at 2007-11-11 22:40:24 >
# 7 Re: Exception in thread "main" java.lang.NoClassDefFoundError: MyApp
Attach software www.cajoon.com to your Java environmeny (J2SE, J2EE) and get 'root-cause' for every exception
abarnea_2000 at 2007-11-11 22:41:22 >