jalopy is used for sourcescrub target of build.xml (sourcescrub is not
[jalview.git] / utils / jalopy / bin / preferences.sh
1 #! /bin/sh
2
3 # OS specific support. $var _must_ be set to either true or false.
4 cygwin=false;
5 darwin=false;
6 case "`uname`" in
7   CYGWIN*) cygwin=true ;;
8   Darwin*) darwin=true ;;
9 esac
10
11 if [ -z "$JAVACMD" ] ; then
12   if [ -n "$JAVA_HOME"  ] ; then
13     if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
14       # IBM's JDK on AIX uses strange locations for the executables
15       JAVACMD=$JAVA_HOME/jre/sh/java
16     else
17       JAVACMD=$JAVA_HOME/bin/java
18     fi
19   else
20     JAVACMD=java
21   fi
22 fi
23
24 if [ ! -x "$JAVACMD" ] ; then
25   echo "Error: JAVA_HOME is not defined correctly."
26   echo "  We cannot execute $JAVACMD"
27   exit
28 fi
29
30 # add in the dependency .jar files
31 # The jar-files are in the same directory as this scriptfile !
32 # So remove the name of this script-file from the path and replace it
33 #   with *.jar
34 DIRLIBS=${0%/*}/../lib/*.jar
35 for i in ${DIRLIBS}
36 do
37   if [ -z "$LOCALCLASSPATH" ] ; then
38     LOCALCLASSPATH=$i
39   else
40     LOCALCLASSPATH="$i":$LOCALCLASSPATH
41   fi
42 done
43
44 # For Cygwin, switch paths to Windows format before running java
45 if $cygwin; then
46   JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
47   LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
48 fi
49
50 $JAVACMD -classpath "$LOCALCLASSPATH" de.hunsicker.jalopy.swing.SettingsDialog