Compiling and executing through commandLine shows NoClassDefFoundError when trying to find Java pack

Posted by eruina on Stack Overflow See other posts from Stack Overflow or by eruina
Published on 2010-06-02T03:11:59Z Indexed on 2010/06/02 3:13 UTC
Read the original article Hit count: 258

I have a client/server program that attempts to send and receive an object.

There are three packages: server, client and shared shared contains only the Message class

I put Message.java from shared package into the same folder as calcclient package source files and calcserver package source files.

I compile using the line: javac -classpath .; Message.java They can compile. Then I change directory up one level and ran with: java -classpath .; .Main

When I use Netbeans to run, the entire program works as per normal. But not if I run from command line. If its executed through command line, the program will work until it needs to use the Message object. Then it will show a NoClassDefFoundError

Am I putting the right files at the right places? How do I get the program to find shared package through command line?

© Stack Overflow or respective owner

Related posts about java

Related posts about compile