• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Put a java project in a jar file

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all!
Don't know if I really put that in the right forum, but I hope you will help me anyway...
I have written a Java application, now I want to pack that application into one jar file so that one is able to execute the jar file and run the application but also that one is able to unzip the jar file and gets the source code (within the same directory structure I used while developing).
I tried out different solutions, and I was -of course- able just to zip the whole project directory into an jar file, but that doesn't allow to execute the application. Then I made a self executable jar file (btw using ant) which was "working" as well except that the some thirdparty libs could not be found (but I put them into the jar as well and also in the classpath entry in the manifest).
Does anyone know a good solution for this problem or a good site which explains this issue in detail? (well I was searching for ages now, but if there's a secret place... )
Thanks ind advance and best regards
Gino
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use utility "jar" to create the jar file from directory tree with
class files.
You need save only class files, not source java files.
[ March 09, 2004: Message edited by: Igor Ko ]
 
Gino Campolo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok thanks!
I found now another acceptable way to provide the sources and the class files in one...
Rgds
 
Igor Ko
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should see description of jar utility: if you wish create
EXECUTABLE jar, you have build some special 'manifest' of
the jar...
(because jar can contains a lot of classes with main function, what
main should use JVM ? According jar manifest)
 
reply
    Bookmark Topic Watch Topic
  • New Topic