Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't run project from command line.

 
Kirk Maze
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kirk,
If you use package you should have package.name.class with dots, not slashes.
HTH
/Torgny
 
Kirk Maze
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic