Results 1 to 6 of 6
Thread: External Jar Library
- 09-24-2009, 03:01 AM #1
Member
- Join Date
- Sep 2009
- Posts
- 6
- Rep Power
- 0
- 09-24-2009, 07:36 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
You distribute both jars, and place the third party jar in a directory beside or under your jarfile and configure the manifest file to reference it. If you are using an IDE, this is done automaitaclly already and you need only grab and distribute the entire directory containing the produced jar. See Lesson: Packaging Programs in JAR Files (The Java™ Tutorials > Deployment)
- 09-24-2009, 09:16 AM #3
Member
- Join Date
- Sep 2009
- Posts
- 6
- Rep Power
- 0
I am using JCreator and my jar creation command is
"cvfm RRegistration.jar manifest.txt *.class".
So to add the external library I would change it to
"cvfm RRegistration.jar manifest.txt *.class miglayout-3.7.1-swing.jar"
and then change the manifest file to what? My Current manifest file is
Main-Class: RRegistration
I tried adding the external MigLayout library to my jar at the base level by using the second statement above, but then when I run the newly created RRobotics.jar through the command line, it returns "NoClassDefFoundError: net/miginfocom/swing/MigLayout" which is the external class I was using in my code.
- 09-24-2009, 10:08 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
You don't jar a jar.
You distribute your jar file, and those it is dependent on.
In the manifest you point to where these other jars are to be found.
This usually results in a directory looking something like:
myJar.jar
lib
-> the other jars referenced by the manifest.
- 09-24-2009, 11:32 AM #5
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
- 09-24-2009, 04:23 PM #6
Member
- Join Date
- Sep 2009
- Posts
- 6
- Rep Power
- 0
I am sorry, I read your post and read through the entire tutorial but I did not understand what you meant by "distribute". I have solved the problem, I tried placing my classes in a package before jar-ing it. I then pointed right next to the jar to find the external library.
Thanks for your help, I am really sorry If I seemed to ignore your post or offend you.
Similar Threads
-
Gwt how to import external gar?
By trust in forum Web FrameworksReplies: 2Last Post: 07-14-2009, 04:31 AM -
external library help
By SIAS87 in forum Java AppletsReplies: 0Last Post: 03-28-2009, 03:12 PM -
External DTD requirements
By jwilley44 in forum XMLReplies: 0Last Post: 03-06-2009, 09:25 PM -
How to execute external EXE?
By 2bGeek in forum AWT / SwingReplies: 3Last Post: 02-21-2009, 12:59 AM -
Tell me jar file for library library org.bouncycastle.cms
By 82rathi.angara in forum New To JavaReplies: 10Last Post: 09-09-2008, 05:11 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks