This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Help with building executable jar with ant. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Help with building executable jar with ant." Watch "Help with building executable jar with ant." New topic
Author

Help with building executable jar with ant.

Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Hello,

I tried to make an executable jar (a jar file that contains a main method, and once a user clicks on it from WinXP, it launches)...

The following code compiles correctly, but when I click on the jar file, nothing happens... Sorry if this post was supposed to be in a different forum other than the one for ant.

Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Did you take a look at the manifest file from the created jar file?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Yes, I did... I extracted the jar file and found a META-INF directory which contained a MANIFEST.MF file...

The MANIFEST.MF file's contents were:



Is this correct? How do I invoke an executable jar from the command line and/or ant target?

Many, many thanks!

All the best,
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
That looks correct. If I remember correctly, though, the file needs to have *two empty lines at the end* (that is, after Main-Class entry). You should check for that...
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Help with building executable jar with ant.
 
Similar Threads
How to include images directory in an executable jar?
assignment JAR problem
Ant, windows xp, and a funky infinite loop
Which IDE support JSP 2.0
package javax.ejb does not exist