* Use java-wrappers instead of the hand-crafted wrapper script; thanks to
[debian/jabref.git] / debian / jabref-wrapper
index 7e40d9c9b9a45314c4345272343ae1e0af131833..e2b391def420d1595c1823e690be0c0d7ab18635 100644 (file)
@@ -1,15 +1,11 @@
 #!/bin/sh
 
-# jabref wrapper script
-# code for java detection borrowed from tuxguitar
+# Include the wrappers utility script
+. /usr/lib/java-wrappers/java-wrappers.sh
 
-if [ -z "$JAVA_HOME" ] ; then
-       t=/usr/lib/jvm/java-1.5.0-sun && test -d $t && JAVA_HOME=$t
-       t=/usr/lib/jvm/java-6-sun && test -d $t && JAVA_HOME=$t
-       t=/usr/lib/jvm/java-7-icedtea && test -d $t && JAVA_HOME=$t
-       test -n "$JAVA_HOME" && JAVA=${JAVA_HOME}/jre/bin/java
-fi
+# We need openjdk6 or sun{5,6} runtime.
+find_java_runtime openjdk || find_java_runtime sunmin5
 
-export JAVA=${JAVA:=java}
+find_jars jabref antlr antlr3 looks forms spin glazedlists microba pdfbox jempbox
 
-exec $JAVA -cp /usr/share/java/jabref.jar:/usr/share/java/antlr.jar:/usr/share/java/antlr3.jar:/usr/share/java/looks.jar:/usr/share/java/forms.jar:/usr/share/java/spin.jar:/usr/share/java/glazedlists.jar:/usr/share/java/microba.jar:/usr/share/java/pdfbox.jar:/usr/share/java/jempbox.jar net.sf.jabref.JabRefMain "$@"
+run_java net.sf.jabref.JabRefMain "$@"