It's not a secret anymore!
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 Customer Requirements for Developers this week in the Jobs Discussion 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: 662

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: 43423
    
  32
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: 662

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: 43423
    
  32
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoClassDefFoundError:
 
jQuery in Action, 3rd edition