From fd9883a5fa9cbf42bd7738beb6052bc4eb12f434 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Mon, 17 Dec 2018 10:37:13 +0000 Subject: [PATCH] JAL-3130 java bash wrapper to choose which java to run (if this is first in path) -- useful when you want javac and java to be from different JAVA_HOME when running ant --- j11jre/bin/java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 j11jre/bin/java diff --git a/j11jre/bin/java b/j11jre/bin/java new file mode 100755 index 0000000..1fff2eb --- /dev/null +++ b/j11jre/bin/java @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +OS=$(uname) + +[ -z $JRE_HOME ] && JRE_HOME=$JAVA_HOME +BASE_DIR=$(dirname ${0}) +BASE_DIR=${BASE_DIR%/bin} + +if [ -z $JRE_HOME ]; then + case $OS in + Darwin) JRE_HOME=$BASE_DIR/openjdk11_macos ;; + Linux) JRE_HOME=$BASE_DIR/openjdk11_linux ;; + esac +fi + +echo $JRE_HOME/bin/java ${@} +$JRE_HOME/bin/java ${@} -- 1.7.10.2