What is the difference between runnable jar library processing options?

So, I will use Java Web Start to deploy a java application. There are three options when exporting to Runnable Jar in eclipse Helios.

  • Retrieving the required libraries in the JAR
  • Required Library Packs in the JAR
  • Copy the required libraries to a subfolder next to the JAR.

What are the differences and how will they affect my .jnlp file?

If this is one jar, isn’t it easier, because I won’t need to write all the different paths to all the libraries that it uses?

If there are changes in the library or in the application, will one jar be the best solution? Or do I need <jar href=''> for each individual library?

Also note that I need to use my own libraries, for example .dll and .so.

+62
eclipse jar java-web-start
Nov 28 2018-11-21T00:
source share
1 answer
  • Retrieving the required libraries in the JAR . Extracts the actual .class files from the libraries that your application uses, and places these .class files in an executable JAR. Thus, the executable JAR will contain not only the .class files of your application, but also the .class files of all the libraries that your application uses.

  • Required package libraries in the JAR . Puts the actual library JAR files into your executable JAR. Typically, a JAR file in a JAR file cannot be loaded by the JVM. But Eclipse adds special classes to the runnable JAR to make this possible.

  • Copy the required libraries to a subfolder next to the JAR . Saves library JAR files completely separate from the executable JAR, so the executable JAR will only contain the .class files of your application.

Option 2 is convenient because it neatly packs everything into a single JAR and saves the library's JAR libraries separately from the .class application files.

However, the drawback of packaging everything inside one JAR (options No. 1 and No. 2) is that when updating the application, the user will have to download more data to update the application. If the JARs are stored separately, the user will only need to download the JAR that contains your application code, and not one massive JAR containing the application code and all the library code.

+111
Dec 01 2018-11-11T00:
source share



All Articles