Java jar jnlp bash launcher

From BITS wiki
Jump to: navigation, search


Description

Create a launcher for some jar or jnlp file


[ Main_Page ]

Usage

Put this as a script with the name you want to use to launch the jar file next to it. Make sure that folder is in your PATH.
The code will execute the jar file using java and memory limit you choose to match your needs.

Code for a jar launcher:

#!/bin/sh
# Stéphane Plaisance - VIB - 2016-06-30 v1.0
#This script is intended for launch on *nix machines
# edit the following two lines to match your jar and required RAM
jar="myapp.jar"
mem="2G"
prefix=$(dirname $(readlink -f $0 || echo $0))
exec java -Xmx${mem} -jar ${prefix}/${jar} "$@"

Code for a jnlp launcher:

#!/bin/sh
 
# Stéphane Plaisance - VIB - 2016-06-30 v1.0
#This script is intended for launch on *nix machines with icedTea
# edit the following two lines to match your jnlp
jnlp="myapp.jnlp"
prefix=$(dirname $(readlink $0 || echo $0))
# javaws ${prefix}/${jnlp} "$@"
javaws.itweb ${prefix}/${jnlp} "$@"



[ Main_Page ]