Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setJava functionality to the docker container #6

Open
A7exSchin opened this issue Aug 11, 2021 · 0 comments
Open

Add setJava functionality to the docker container #6

A7exSchin opened this issue Aug 11, 2021 · 0 comments

Comments

@A7exSchin
Copy link
Contributor

Title, see script below (adjust for debian)

#!/bin/bash                                                                                                                                                                                                   

#env variables can be changed only if we call the script with source setJava.sh                                                                                                                         

function removeFromPath () {
    export PATH=$(echo $PATH | sed -E -e "s;:$1;;" -e "s;$1:?;;")
}

if [ -n "${JAVA_HOME+x}" ]; then  
    removeFromPath $JAVA_HOME  
fi

oracleJava="/c/Program Files (x86)/Common Files/Oracle/Java/javapath"

case $1 in
	unset)
	    removeFromPath $oracleJava
		export JAVA_HOME=
	;;
	8)
		export JAVA_HOME=/c/ENGINE_LIB_DIR/build/java/win32/x86_64/jdk8u202-b08
	;;
	11)
		export JAVA_HOME=/c/ENGINE_LIB_DIR/build/java/win32/x86_64/jdk-11.0.5+10
	;;
	pai11)
		export JAVA_HOME=/C/ENGINE_LIB_DIR/build/java/win32/x86_64/pai-openjdk-11.0.5.10_windows-x64
	;;
	*)
		echo "usage error: setJava <version>\n version can be one of unset, 8, 11, pai11"
	;;
esac

echo JAVA_HOME=$JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH;
java -version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant