Last change
on this file since 7506 was 7506, checked in by Don-vip, 10 years ago |
fix svn:executable bits
|
-
Property svn:executable
set to
*
|
File size:
1.6 KB
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 | # Simple wrapper script used to start JOSM in Debian
|
---|
3 | set -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
|
---|
7 | ALTERNATIVE_JDK="`readlink -n -f /etc/alternatives/java`"
|
---|
8 |
|
---|
9 | # Let's get the current architecture -- needed for multiarchified Java
|
---|
10 | ARCH="`dpkg --print-architecture 2> /dev/null || true`"
|
---|
11 |
|
---|
12 | # If OpenJDK is only available headless, do not try it
|
---|
13 | if 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 /usr/lib/jvm/java-8-oracle/bin/java"
|
---|
15 | else
|
---|
16 | JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/lib/jvm/java-8-oracle/bin/java /usr/bin/java"
|
---|
17 | fi
|
---|
18 |
|
---|
19 | JAVA_OPTS="-Djosm.restart=true -Djosm.home=$HOME/.josm-latest -Djava.net.useSystemProxies=true $JAVA_OPTS"
|
---|
20 |
|
---|
21 | for jcmd in $JAVA_CMDS; do
|
---|
22 | if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then
|
---|
23 | JAVACMD="$jcmd"
|
---|
24 | fi
|
---|
25 | done
|
---|
26 |
|
---|
27 | for jcmd in $JAVA_CMDS; do
|
---|
28 | if [ -x "$jcmd" -a -z "${JAVACMD}" ]; then
|
---|
29 | JAVACMD="$jcmd"
|
---|
30 | fi
|
---|
31 | done
|
---|
32 |
|
---|
33 | if [ "$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
|
---|
43 | else
|
---|
44 | echo "No valid JVM found to run JOSM." || true
|
---|
45 | exit 1
|
---|
46 | fi
|
---|
Note:
See
TracBrowser
for help on using the repository browser.