noclassdeffound error

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2007
Posts: 12
Reputation: randomFIRE is an unknown quantity at this point 
Solved Threads: 0
randomFIRE randomFIRE is offline Offline
Newbie Poster

noclassdeffound error

 
0
  #1
Dec 22nd, 2008
I am getting this error
Exception in thread "main" java.lang.NoClassDefFoundError: TestApp (wrong name: Test/TestApp)
which I have googled and tried suggestions, but it doesn't fix it. I have tried unsetting my CLASSPATH etc. and it doesn't work. The file TestApp.class IS in the directory that I am running the program from.

I only get this error when I try and put my two classes in "package Test;" Otherwise it executes fine.

Thanks for the help
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,508
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 522
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: noclassdeffound error

 
0
  #2
Dec 22nd, 2008
If you define them to be in package Test; , you'll need to run it from the directory above Test with the command java Test.TestApp
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 12
Reputation: randomFIRE is an unknown quantity at this point 
Solved Threads: 0
randomFIRE randomFIRE is offline Offline
Newbie Poster

Re: noclassdeffound error

 
0
  #3
Dec 22nd, 2008
Yay thanks! I didn't understand thats where I was supposed to run it from I guess.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC