Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executable jar files

 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Carl Trusiak
Sheriff
Posts: 3340
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
Hari Haran
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic