n0b3l1a

Just a collection of some random cool stuff. PS. Almost 99% of the contents here are not mine and I don't take credit for them, I reference and copy part of the interesting sections.

Friday, July 12, 2013

Java jar files - FatJar

http://fjep.sourceforge.net/#inst


The Fat Jar Eclipse Plug-In is a Deployment-Tool which deploys an Eclipse java-project into one executable jar.

It adds the Entry "Build Fat-JAR" to the Export-Wizard.
In addition to the eclipse standard jar-exporter referenced classes and jars are included to the "Fat-Jar", so the resulting jar contains all needed classes and can be executed directly with "java -jar", no classpath has to be set, no additional jars have to be deployed.

Jars, External-Jars, User-Libraries, System-Libraries, Classes-Folders and Project-Exports are considered by the plugin.
The Main-Class can be selected and Manifest-files are merged.
The One-JAR option integrates a specialised Class-Loader written by Simon Tuffs ( http://one-jar.sourceforge.net/ ) which handles jar-files inside a jar.
Individual files and folders can be excluded or added to the jar.
Different settings can be stored and re-executed as "Quick Build" via the context-menu.

Or

JARS=$(echo ${LIB_DIR}/* | tr ' ' ':')

java -classpath $JARS org.HelloWorld


Or

in Linux (Java 1.6 and above)

java -cp ".:../lib/*" org.HelloWorld


Maven shaded plugin
n0b3l1a at 1:39 PM

No comments:

Post a Comment

‹
›
Home
View web version
Powered by Blogger.