* Change wrapper script /usr/bin/jabref to explicitly use the Sun Java
[debian/jabref.git] / jabref
diff --git a/jabref b/jabref
index 723500d460a965075edc6990512fd523772945a0..a782159f0d10c48dfb25f436d070f146e048a96b 100644 (file)
--- a/jabref
+++ b/jabref
@@ -1,4 +1,15 @@
 #!/bin/sh
 
 #!/bin/sh
 
-java -jar /usr/share/java/jabref.jar "$@"
+# jabref wrapper script
+# code for java detection borrowed from tuxguitar
 
 
+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
+JAVA=${JAVA_HOME}/jre/bin/java
+fi
+
+export JAVA=${JAVA:=java}
+
+$JAVA -jar /usr/share/java/jabref.jar "$@"