Library Linking

N

newbie

I am trying to create a runnable jar file specfiication in eclipse.
Could someone tell me the differences between:

- Extract required libraries into generated jar
- Package required libraries into generated jar
- copy required libraries into a sub folder next to the generated jar

I am just interested in having my packages together and adding some
junit and selenium server files together and being able to create a
jar that will allow me to click on my jar file run my code and start
selenium up for my tests but do this outside eclipse.

Andrew
 
L

Lew

I am trying to create a runnable jar file specfiication in eclipse [sic].
Could someone tell me the differences between:

- Extract required libraries into generated jar [sic]

I don't call that "extract". You put required libraries into subdirectories
with your JAR, not in your JAR.
- Package required libraries into generated jar [sic]
Ditto.

- copy required libraries into a sub folder next to the generated jar
Bingo!

I am just interested in having my packages together and adding some
junit [sic] and selenium [sic] server files together and being able to create a
jar [sic] that will allow me to click on my jar [sic] file run my code and start
selenium [sic] up for my tests but do this outside eclipse [sic].

Put your JARs in the same directory, or put your libraries in a subdirectory
under your main JAR. Fill in the main JAR manifest with the "Class-Path:"
information, as documented in Oracle's web site. Package the main JAR and
libraries as a ZIP file for distribution, unpack the ZIP at the target station
for deployment. Associated "java -jar" with JAR files at the OS level. (Read
up at the Oracle site on what the "-jar" option does.)
 
A

Arne Vajhøj

I am trying to create a runnable jar file specfiication in eclipse.
Could someone tell me the differences between:

- Extract required libraries into generated jar

I believe this mean that the class files in the required libraries
will be extracted and added to the jar you are building.
- Package required libraries into generated jar

I believe this mean that the required libraries
will be added to the jar you are building in root.
- copy required libraries into a sub folder next to the generated jar

This means that the required jar files will be copied to where
the jar you are building is (in a subdirectory).
I am just interested in having my packages together and adding some
junit and selenium server files together and being able to create a
jar that will allow me to click on my jar file run my code and start
selenium up for my tests but do this outside eclipse.

I will suggest the third option and a Class-Path directive
in the manifest of the jar you are building.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top