comparison zshrc-jdk @ 153:aa8f422d55ae

add openjdk8
author Dirk Olmes <dirk@xanthippe.ping.de>
date Thu, 07 Mar 2019 04:37:47 +0100
parents 62c9cbe45942
children c78e098abad3
comparison
equal deleted inserted replaced
152:62c9cbe45942 153:aa8f422d55ae
2 # zshrc for handling different JDK versions 2 # zshrc for handling different JDK versions
3 # 3 #
4 4
5 switchJdk() { 5 switchJdk() {
6 local jdkName="$1" 6 local jdkName="$1"
7 local new_path=`removeFromPath "jdk"` 7 local new_path=$(removeFromPath "jdk")
8 export JAVA_HOME=`/usr/bin/java-config-2 --select-vm=${jdkName} -O` 8 export JAVA_HOME=$(/usr/bin/java-config-2 --select-vm=${jdkName} -O)
9 export JAVAC=${JAVA_HOME}/bin/javac 9 export JAVAC=${JAVA_HOME}/bin/javac
10 export JDK_HOME=${JAVA_HOME} 10 export JDK_HOME=${JAVA_HOME}
11 export PATH="${JAVA_HOME}/bin":"${new_path}" 11 export PATH="${JAVA_HOME}/bin":"${new_path}"
12 java -version 12 java -version
13 } 13 }
14 14
15 jdk8() { 15 jdk8() {
16 switchJdk "oracle-jdk-bin-1.8" 16 switchJdk "oracle-jdk-bin-1.8"
17 } 17 }
18 18
19 jdk11() { 19 openjdk8() {
20 export JAVA_HOME=/opt/openjdk-bin-11.0.2_p7 20 export JAVA_HOME=/opt/openjdk-bin-8.202_p08
21 21
22 local new_path=`removeFromPath "jdk"` 22 local new_path=$(removeFromPath "jdk")
23 export PATH="${JAVA_HOME}/bin":"${new_path}" 23 export PATH="${JAVA_HOME}/bin":"${new_path}"
24 java -version 24 java -version
25 } 25 }
26
27 openjdk11() {
28 export JAVA_HOME=/opt/openjdk-bin-11.0.2_p7
29
30 local new_path=$(removeFromPath "jdk")
31 export PATH="${JAVA_HOME}/bin":"${new_path}"
32 java -version
33 }