# Script assumes you are in the same directory as rk-setup.bash when it is sourced if [ "x$RK_HOME" != "x" ] ; then echo "Your Environment has already been set up for the Greenstone Release Kit!!" return 0 fi # https://stackoverflow.com/questions/59895/how-can-i-get-the-source-directory-of-a-bash-script-from-within-the-script-itsel # SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" export RK_HOME="`pwd`" export PATH="$RK_HOME/bin":$PATH echo "Set RK_HOME and added RK_HOME/bin into PATH" # Set JAVACFLAGS (used in the relevant javac lines in our Makefiles) # so that any compiled Java code is backwards compatible with Java v1.8 # To fully support backward compatible compilation need to specfiy # -bootclasspath in addition to -source and -target # Note: Given the way autoconf/configure uses 'eval' to test for # javac, then the usual technique of double-quoting (e.g.) the # bootclasspath directory to project against spaces *doesn't* # *work* as in an eval it is not passed to a shell environment # to be interpretted first. The main outcome of all of this # is that we need to resort to backlash escaping any spaces # to keep things on track jrt_home_dir="$RK_HOME/shared/core/java-rt" rt_jar="$jrt_home_dir/rt-openjdk8.jar" jce_jars="$jrt_home_dir/jce1_2_2.jar:$jrt_home_dir/local_policy.jar:$jrt_home_dir/US_export_policy.jar:$jrt_home_dir/sunjce_provider.jar" bootclasspath="$rt_jar:$jce_jars" bootclasspath_backslash_escaped=`echo $bootclasspath | sed 's/ /\\\\ /g'` export JAVACFLAGS="-source 1.8 -target 1.8 -bootclasspath $bootclasspath_backslash_escaped -extdirs ''" echo "Set JAVACFLAGS to compile for source, and to target, 1.8"