Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

NoClassDefFoundError for applications, but not for applets

Thread view: 
Tex2000 - 10 Mar 2006 14:40 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
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.