This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes java.lang.NoClassDefFoundError: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java.lang.NoClassDefFoundError:" Watch "java.lang.NoClassDefFoundError:" New topic
Author

java.lang.NoClassDefFoundError:

Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 659

I'm trying to compile my little application from the command line to check if it takes command line parameters, however, it's not compiling.

The source code originally was compiled at C:\Users\Administrator\workspace\ChopLineNumbers\bin\homenetwork\bkr\training (which is my Eclipse workspace sub directory.






1. Source code includes the class ChopLineNumbers


Jon
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
The problem is not with your code, but with your file structure. You should have a "training" folder, inside a "bkr" folder, inside a "homenetwork" folder, and you invoke that class from just outside the homenetwork folder with the instruction

java homenetwork.bkr.training.ChopLineNumbers

Remember that IDEs can use a different folder structure from what you get at the command line. Resources: Java™ tutorials, and recent thread about a related problem. Please note the link to older threads and look at them; similar problems come up quite frequently.
Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 659

Campbell Ritchie wrote:The problem is not with your code, but with your file structure. You should have a "training" folder, inside a "bkr" folder, inside a "homenetwork" folder, and you invoke that class from just outside the homenetwork folder with the instruction

java homenetwork.bkr.training.ChopLineNumbers

Remember that IDEs can use a different folder structure from what you get at the command line. Resources: Java™ tutorials, and recent thread about a related problem. Please note the link to older threads and look at them; similar problems come up quite frequently.


That's it thanks.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoClassDefFoundError:
 
Similar Threads
[newbie] Null pointer exception ??
[newbie] String.replace()/replaceAll() removed spaces
[newbie] bracketing error
[newbie] regex anomaly