source: josm/trunk/linux/latest/usr/bin/josm-latest@ 7481

Last change on this file since 7481 was 7481, checked in by Don-vip, 10 years ago

move debian/ubuntu documentation, scripts and resources from internal repo to public one

File size: 1.5 KB
Line 
1#!/bin/sh
2# Simple wrapper script used to start JOSM in Debian
3set -e
4
5# First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK or Oracle's proprietary JDK.
6# Override to a specific one using $JAVACMD
7ALTERNATIVE_JDK="`readlink -n -f /etc/alternatives/java`"
8
9# Let's get the current architecture -- needed for multiarchified Java
10ARCH="`dpkg --print-architecture 2> /dev/null || true`"
11
12# If OpenJDK is only available headless, do not try it
13if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ; then
14 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java"
15else
16 JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java"
17fi
18
19JAVA_OPTS="-Djosm.restart=true -Djosm.home=$HOME/.josm-latest -Djava.net.useSystemProxies=true $JAVA_OPTS"
20
21for jcmd in $JAVA_CMDS; do
22 if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then
23 JAVACMD="$jcmd"
24 fi
25done
26
27for jcmd in $JAVA_CMDS; do
28 if [ -x "$jcmd" -a -z "${JAVACMD}" ]; then
29 JAVACMD="$jcmd"
30 fi
31done
32
33if [ "$JAVACMD" ]; then
34 echo "Using $JAVACMD to execute josm-latest." || true
35 set +e
36 while true; do
37 $JAVACMD $JAVA_OPTS -jar /usr/share/josm-latest/josm-latest.jar "$@"
38 if [ "z$?" != "z9" ]; then
39 break
40 fi
41 echo ">> restarting josm..."
42 done
43else
44 echo "No valid JVM found to run JOSM." || true
45 exit 1
46fi
Note: See TracBrowser for help on using the repository browser.