This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

another Jar problem!  RSS feed

 
Alistair Rooney
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

I know I'm doing something really daft here, but I can't get my jar to run!

I have two packages jarred and the main class lives in one of them. The manifest looks ok:>>


but running it gives me the dreaded:>>

The jar is generated from Eclipse, I have a sneaky feeling it has something to do with the packages.

Can anyone point me in the right direction?

Alistair
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try removing the semicolon from the classpath

Jar tutorial
 
Alistair Rooney
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Carol - did that. Sadly I get the same error.
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, it's not finding the main class. What does the directory structure look like in the jar that you are showing the manifest?

Does it have this in it?

za/co/saponet/sap/server/StartServer.class
 
Alistair Rooney
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes - I'm beginning to think this is an Eclipse funny.
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What jar is it in? What command are you running? Details please.

You could show the result of jar tvf thejarname.jar run on command-line.
[ February 28, 2007: Message edited by: Carol Enderlin ]
 
Alistair Rooney
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Carol - here it is:

C:\Navis>jar tvf SAPServer.jar
107 Wed Feb 28 19:08:02 CAT 2007 META-INF/MANIFEST.MF
0 Tue Feb 27 19:42:38 CAT 2007 za/
0 Tue Feb 27 19:42:38 CAT 2007 za/co/
0 Tue Feb 27 19:42:38 CAT 2007 za/co/saponet/
0 Tue Feb 27 19:42:38 CAT 2007 za/co/saponet/sap/
0 Tue Feb 27 19:42:38 CAT 2007 za/co/saponet/sap/database/
4358 Wed Feb 28 14:19:16 CAT 2007 za/co/saponet/sap/database/Navis.class
1170 Wed Feb 28 15:03:10 CAT 2007 za/co/saponet/sap/database/TestDB.class
0 Tue Feb 27 09:14:58 CAT 2007 za/co/saponet/sap/server/
308 Fri Feb 16 12:31:28 CAT 2007 za/co/saponet/sap/server/StartSapCom.class
529 Wed Feb 28 13:37:46 CAT 2007 za/co/saponet/sap/server/StartServer$Reposit
ory.class
5673 Wed Feb 28 13:37:46 CAT 2007 za/co/saponet/sap/server/StartServer$Server.
class
5152 Wed Feb 28 13:37:46 CAT 2007 za/co/saponet/sap/server/StartServer.class

Alistair
 
Alistair Rooney
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh and the command is java -jar SAPServer.jar in the same directory.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure the manifest file ends with an empty line, otherwise it will not work.

See this page from The Java Tutorial; it says:

Warning : The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.
 
Alistair Rooney
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks - I've got two crs at the end. I think I'll jar it manually and see if that helps. (Instead of Eclipse). Thanks for your suggestions though!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!