This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Executable jar files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Executable jar files" Watch "Executable jar files" New topic
Author

Executable jar files

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I am working on a JAVA editor and have nearly completed it.My problem I want to make it an exceutable file.I have heard that it is possible to make executable jar files .How is it done?
Please reply
gagan goyal
Greenhorn

Joined: Nov 29, 2003
Posts: 4
hi ,
I heard that a jar can be made executable by adding an entry
main-class: class name , in the manifest file but this didn't work for me . i might have gone wrong somewhere . this is the hint that i can give you for now . if i get something on this i will let u know . if you get to know something on this please mail to

gagan.p@usa.net
thanx in advance .
gagan goyal
Greenhorn

Joined: Nov 29, 2003
Posts: 4
hi ,
I heard that a jar can be made executable by adding an entry
main-class: class name , in the manifest file but this didn't work for me . i might have gone wrong somewhere . this is the hint that i can give you for now . if i get something on this i will let u know . if you get to know something on this please mail to

gagan.p@usa.net
thanx in advance .
prakash muthu
Ranch Hand

Joined: Sep 06, 2000
Posts: 75
Hi hari
Whether you want to create a normal jar file or execuatble file like exe. Bcoz i got some jar file like exe.
If you want to create a normal jar file then
jar cvf jarfilename listoffile
Let me know your requirement
with regards
Prakash
(prakash.m@db.com)


Prakash.M<BR>Bangalore- India<BR>(prakashem@rediffmail.com)
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Originally posted by gagan:

I heard that a jar can be made executable by adding an entry
main-class: class name , in the manifest file but this didn't work for me .

Try changing the entry to
Main-Class: classname
Remember java is CASE sensitive!
Hope This helps

[This message has been edited by Carl Trusiak (edited September 20, 2000).]


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Hari Haran
Greenhorn

Joined: Sep 21, 2000
Posts: 19
Hi folks,
The executable jar file is just working fine:
Thanks for ur support.
I am just passing on the steps so that it may be useful:
Steps for Creating executable Jar Files.
1.Create the java Program and compile It.
2.Make a manifest file(eg:Manifest.mf) as follows:
Main-Class: <class file name which has the main method>
eg:
===
Main-Class: Test
3.Make the jar file:
jar -cfm <Filename>.jar <Manifestfile> <list of classes in the java program>
eg:
===
jar -cfm Test.jar Manifest.mf Test.class Test1.class
4.U have the executable jar file
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Executable jar files
 
Similar Threads
How to Make Executable War File for Web App
about jar ???
executable jar
Problem in creating executable jar (Eclipse)
how to make executable program in java ?