Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Executable jar files

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • 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
 
Greenhorn
Posts: 4
  • 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
  • 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 .
 
Ranch Hand
Posts: 75
  • 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)
 
Sheriff
Posts: 3341
  • 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).]
 
Greenhorn
Posts: 19
  • 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
 
    Bookmark Topic Watch Topic
  • New Topic