diff --git a/build/main/hop.bat b/build/main/hop.bat index ad4d6968..06771c62 100755 --- a/build/main/hop.bat +++ b/build/main/hop.bat @@ -35,7 +35,7 @@ rem set JAVA_OPTIONS=-server -Xmx128m ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Setting the script path -set SCRIPT_DIR=%~d0%~p0 +set INSTALL_DIR=%~d0%~p0 :: Using JAVA_HOME variable if defined. Otherwise, :: Java executable must be contained in PATH variable @@ -48,7 +48,7 @@ if "%JAVA_HOME%"=="" goto default :: Setting HOP_HOME to script path if undefined if "%HOP_HOME%"=="" ( - set HOP_HOME=%SCRIPT_DIR% + set HOP_HOME=%INSTALL_DIR% ) cd %HOP_HOME% @@ -76,4 +76,4 @@ if not "%HOP_HOME%"=="" ( ) :: Invoking the Java virtual machine -%JAVACMD% %JAVA_OPTIONS% -jar launcher.jar %OPTIONS% +%JAVACMD% %JAVA_OPTIONS% -jar "%INSTALL_DIR%\launcher.jar" %OPTIONS% diff --git a/build/main/hop.sh b/build/main/hop.sh index 1126339c..9ab42a07 100644 --- a/build/main/hop.sh +++ b/build/main/hop.sh @@ -1,7 +1,7 @@ #!/bin/sh # Shell script for starting Helma with a JDK-like virtual machine. -# To add JAR files to the classpath, simply place them into the +# To add JAR files to the classpath, simply place them into the # lib/ext directory. # uncomment to set JAVA_HOME variable @@ -32,6 +32,11 @@ else JAVACMD=java fi +# Get the Helma installation directory +INSTALL_DIR="${0%/*}" +cd $INSTALL_DIR +INSTALL_DIR=$PWD + # get HOP_HOME variable if it isn't set if test -z "$HOP_HOME"; then # try to get HOP_HOME from script file and pwd @@ -64,5 +69,5 @@ if [ "$HOP_HOME" ]; then SWITCHES="$SWITCHES -h $HOP_HOME" fi -# Invoking the Java VM -$JAVACMD $JAVA_OPTIONS -jar launcher.jar $SWITCHES +# Invoke the Java VM +$JAVACMD $JAVA_OPTIONS -jar "$INSTALL_DIR/launcher.jar" $SWITCHES