Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

JAR Launcher

A launcher that starts the main class specified in a JAR while preserving the CLASSPATH.
Workaround for java -classpath ... -jar ... which does not work.

This is useful for injecting dependencies at runtime, e.g. when using Zero Install.

Build status

Building

Run mvn package to generate target/jar-launcher-X.Y.jar.

Usage

You can manually invoke jar-launcher like this:

java -classpath target/jar-launcher-X.Y.jar:Application.jar:/directory/containing/library net.zeroinstall.jar.launcher.JarLauncher Application.jar

Note: Using jar-launcher disables all the default classpath handling for JARs. Therefore, the classpath must explicitly list the jar-launcher JAR and the Application JAR.

jar-launcher is usually used in Zero Install feeds like this:

<command name="run" path="Application.jar" />
	<runner interface="https://apps.0install.net/java/jar-launcher.xml" />
</command>
<environment name="CLASSPATH" insert="Application.jar" />
<requires interface="http://some/library.xml">
	<environment name="CLASSPATH" insert="Library.jar" />
</requires>

About

launcher that starts the main class specified in a JAR while preserving the CLASSPATH

Resources

License

Languages

You can’t perform that action at this time.