File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Can't run project from command line. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Can Watch "Can New topic
Author

Can't run project from command line.

Kirk Maze
Ranch Hand

Joined: May 14, 2002
Posts: 32
This is probably a simple question for all of you who do a lot of work at at the command line with jarred bundles, but it a brave new world for me!
Anyway, my project works fine in my ide. From the command line I'm entering:

I get back:

If I click on the jar file in Windows, I get a Window error box that says:
"Could not find the main class. Program will exit!"
My manifest file says this:

And the class RunGui.class is in fact in the jar file.
If I change the Main-Class name in the manifest file to the fully qualified path, I get:


So I don't think that's right either.
Any idea what I'm doing wrong?
Thanks!
Kirk


Sun Certified Java Developer<br />Sun Certified Java Programmer
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Kirk,
If you use package you should have package.name.class with dots, not slashes.
HTH
/Torgny
Kirk Maze
Ranch Hand

Joined: May 14, 2002
Posts: 32
Thanks Torgny! I just came back to post that I'd figured it out, but you'd already beat me to it. Funny how you can get so wedded to an OS with a gui!
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Indeed !
If it doesn\t work with slashes use dots, for rmic it's the package name (dots) for javac it's path (slashes). For getResource() it's slashes. So it's conistent, in a way
Cheers
/T
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't run project from command line.