• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating an executable jar (solved)  RSS feed

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all, the questions seems not that hard, but I can't figure it out. What I want to do is create an executable jar.
But my directory structure is like this

In my jar, I want to include the lib (for my L&F), the resources (for .properties and images) and the classes tree, starting at the /net.
I created a manifest file, called mainClass.txt (also had other names, but no effect) which looked like this:

Now, I jarred everything up using

This works, but when double clicking on the .jar file, it gives an error about an incorrect manifest, and when I open the jar file with Winzip, I see the manifest, but it does not containt the Main-Class line, only a version number, and something else (can't remember which line).
What am I doing wrong??
Thanks for any replies,
Erik Pragt
[ January 12, 2004: Message edited by: Erik Pragt ]
[ January 12, 2004: Message edited by: Erik Pragt ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Specify the manifest text document before the JAR file name.
Take a look at the Creating an Executable JAR thread for working examples.
 
Erik Pragt
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dirk, for your reply.
I tested your suggesting, by typing the following command:

But no file gets created. Instead, the usage of jar.exe shows, and the suprising thing is that is says the following:

To be more specific, the usage says to put the manifest file behind the name of the jar file. Could you help me al little further?
Greetings, Erik
 
Erik Pragt
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Update:
It is solved now.
This is my solution:

(the sequence of the cfm matters!)
with this manifest:

Only my L&F is not working yet, but I think I'll get it to work.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!