This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Put a java project in a jar file

 
Gino Campolo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
Igor Ko
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic