Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.NoClassDefFoundError:

 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Campbell Ritchie
Sheriff
Pie
Posts: 49396
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49396
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic