Execute Java Classes from command line (windows)

A

andrewzzz

Hi everybody,
I created a project with 2 packages , and no external libraries
required , that works well on eclipse.
But when I try to run it from command line java give me strange
errors : (note that java is correctly set to the path).

My project is located at C:\thesis\thesis\classes
then I have 2 packages "app" and "agentLibrary".
I have simply to exectute the Main class in "app" (which cointains
reference to some "agentLibrary" classes).(The main class has a void
main method with no parameters).
I tried this : C:> java -classpath C:\thesis\thesis\classes\ app.Main
but I get errors...Exception in thread "main"
java.lang.NoClassDefFoundError app/Main
How do I solve this problem?
Thanks!!
 
T

Thomas Fritsch

andrewzzz said:
I created a project with 2 packages , and no external libraries
required , that works well on eclipse.
But when I try to run it from command line java give me strange
errors : (note that java is correctly set to the path).

My project is located at C:\thesis\thesis\classes
then I have 2 packages "app" and "agentLibrary".
I have simply to exectute the Main class in "app" (which cointains
reference to some "agentLibrary" classes).(The main class has a void
main method with no parameters).
Wrong! The main method must have a String[] parameter.
I tried this : C:> java -classpath C:\thesis\thesis\classes\ app.Main
but I get errors...Exception in thread "main"
java.lang.NoClassDefFoundError app/Main
It seems there is no file C:\thesis\thesis\classes\app\Main.class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top