I am writing some Java programs at home. A few months ago I could
compile Java applications and applets just fine - something must have
changed. I can still compile and use applets, and still compile
applications. But I cannot run Java applications. I always get
Exception in thread "main" java.lang.NoClassDefFoundError:
application.java. I am using the Java 1.4.2_04 development kit.
Any thoughts would be much appreciated.
Tex2000
Jan Thomä - 10 Mar 2006 14:46 GMT
>I always get
> Exception in thread "main" java.lang.NoClassDefFoundError:
the full stacktracke and maybe your main method would help to track down
the issue.
Best regards,
Jan
Tex2000 - 10 Mar 2006 18:09 GMT
> >I always get
> > Exception in thread "main" java.lang.NoClassDefFoundError:
[quoted text clipped - 4 lines]
> Best regards,
> Jan
I tried the -verbose command line option on java.exe, but it does not
offer much help. It does show that it is able to load many classes from
c:\j2sdk1.4.2_04\jre\lib\rt.jar. However, I also have run time
environments under c:\Program Files\Java. Specifically I have:
c:\Program Files\Java\j2re1.4.1_02
c:\Program Files\Java\j2re1.4.2_01
c:\Program Files\Java\j2re1.4.2_04
I suspect my problems started after I loaded a QuickTime viewer some
weeks ago, as my class path now points to
c:\j2re1.4.2_04\lib\ext\QTJava.zip. Since I didn't have time to fix it
then I've restricted myself to writing Java applets.
Tex2000
dashing - 10 Mar 2006 20:04 GMT
Asalam o alikum...
you problem is not much bigger
just go tu cmd and then write..
set classpath= ; (than press enter)
OR
go to the properties of my computer and select advance in it after
that click on environment variable. Now you have seen system variables
in downward so select classpath there and click on edit , than set its
value = ";" that is semicolumm ..
isallah your problem will be solve
thankyou
Alex Hunsley - 10 Mar 2006 14:46 GMT
> I am writing some Java programs at home. A few months ago I could
> compile Java applications and applets just fine - something must have
[quoted text clipped - 6 lines]
>
> Tex2000
Google for "java classpath".
Jan Thomä - 10 Mar 2006 14:59 GMT
> I always get
> Exception in thread "main" java.lang.NoClassDefFoundError:
> application.java.
Doh, missed this at the first glance. it looks for application.java
class this tells me you probably tried to start the program with
something like:
java application.java
which won't work. You have to start the program with
java <classname>
so if you got a class named "application" you gotta start it like this:
java application
do not append that ".java" thingy.
Greetings,
Jan