Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

Execute Java Classes from command line (windows)

Thread view: 
andrewzzz - 27 Feb 2007 11:02 GMT
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!!
Thomas Fritsch - 27 Feb 2007 11:55 GMT
andrewzzz schrieb:
> I created a project with 2 packages , and no external libraries
> required , that works well on eclipse.
[quoted text clipped - 6 lines]
> 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

Signature

Thomas



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.