Creator: hasufell Date: 25.02.2012 fix JDKDIR not correctly recognized, because we use system-jdk fix CLASSPATH, because we use system-libs for ant.jar,ant-launcher.jar,antlr.jar,ecj.jar,jna.jar tested on gentoo --- processing +++ processing @@ -30,7 +30,6 @@ fi } - # Locates JDKLIBS in a directory and its subdirectories and saves their # absolute paths as list to JDKCP. Expects the directory as parameter $1. # Sets SUCCESS to 1 if all libraries were found, to 0 otherwise. @@ -64,37 +63,23 @@ log JDKCP } - # Get absolute path of directory where this script is located APPDIR=`readlink -f "$0"` APPDIR=`dirname "$APPDIR"` log APPDIR -# Try using a local JDK from the same directory as this script -JDKDIR=`readlink -f "$APPDIR/java"` -make_jdkcp "$JDKDIR" +make_jdkcp $(java-config -O) log SUCCESS - -# Local JDK found? -if [ $SUCCESS -ne 1 ]; then - # No, try using the preferred system JRE/JDK (if any) - JDKDIR=`which java` && JDKDIR=`readlink -e "$JDKDIR"` && JDKDIR=`dirname "$JDKDIR"`/.. - make_jdkcp "$JDKDIR" - log SUCCESS -fi - + # Add all required JARs to CLASSPATH -CLASSPATH="$CLASSPATH"${CLASSPATH:+:}"$JDKCP" +CLASSPATH="${CLASSPATH+$CLASSPATH:}$JDKCP" for LIB in "$APPDIR"/lib/*.jar; do - CLASSPATH="$CLASSPATH"${CLASSPATH:+:}"$LIB" + CLASSPATH="${CLASSPATH+$CLASSPATH:}$LIB" done +CLASSPATH="${CLASSPATH+$CLASSPATH:}$(java-config -dp ant-core):$(java-config -dp antlr):$(java-config -dp eclipse-ecj-3.7):$(java-config -dp jna)" export CLASSPATH log CLASSPATH -# Make all JDK binaries available in PATH -export PATH="$JDKDIR/bin":"$PATH" -log PATH - # Start Processing in the same directory as this script cd "$APPDIR" if [ "$1" ]; then