aspose file tools*
The moose likes Java in General and the fly likes Jar question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Jar question" Watch "Jar question" New topic
Author

Jar question

Mohamed Farouk
Ranch Hand

Joined: Jun 08, 2005
Posts: 247
Hello Friends
I have created a java application which I now need to jar up and make the client run usign command prompt. Now these classes inorder for them to compile correctly they need loads of other IBM Jars. And to run they need other set of jars what is the best way to create my application jar. I do not want to have any third party jars inside my application jar as it would be inflexible. What is the general procedure regarding creating application jars and third party jars
Any help will be much appreciated..
Regards
Farouk


SCJP, SCWCD, SCBCD, SCEA 5
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 685
One way would be to use the manifest file's Class-Path: entry to point to the other jar files. If all the jar files were in the same folder, you could use . ie Class-Path: .
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
First club your custom application in a jar file. And put other required jars (IBM’s jars and jars required by IBM’s jars) to JAVA_HOME\jre\lib\ext folder.

Whatever jars you put in JAVA_HOME\jre\lib\ext folder is automatically available runtime. No need to include them in classpath.


My blood is tested +ve for Java.
Mohamed Farouk
Ranch Hand

Joined: Jun 08, 2005
Posts: 247
Thanks for your help
So for run time jars I am sorted what about compiled classes as my applicaiton requires certain jars from IBM to even compile. So if I jar my class files only without IBM Jars which I used to compile will it work
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 685
>will it work
Try it and see. Often faster and usually you get the correct answer.
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Use Ant to build and create the (runnable) application JAR (including the manifest). You can always have separate targets to build with and without the third party JARs.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Rick O'Shay
Ranch Hand

Joined: Sep 19, 2004
Posts: 531
Originally posted by Chetan Parekh:
Whatever jars you put in JAVA_HOME\jre\lib\ext folder is automatically available runtime. No need to include them in classpath.


That is seriously flawed advice. Let's assume you overcome the practical problems in updating a user's JRE folder. Those jars can run unrestricted regardless of any security settings. The extension folder is for bona fide Java extensions. Use -classpath setting of java and javac and the Class-Path setting in you manifiest for jar files that need to designate dependent jars.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jar question
 
Similar Threads
Any solutions to support MathML within JEditorPane
MathML support in Java Swing application.
Exception in displaying data in a pdf format
Third party place for EJB.
jar file with in a jar file