annotate zshrc-jdk @ 155:1a9d4664aafb

add openjdk12
author Dirk Olmes <dirk@xanthippe.ping.de>
date Wed, 08 May 2019 13:17:50 +0200
parents c78e098abad3
children 2f71ba394858
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8b245298349a zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
1 #
152
62c9cbe45942 update JDK11 path
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 148
diff changeset
2 # zshrc for handling different JDK versions
0
8b245298349a zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
3 #
8b245298349a zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
4
8b245298349a zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
5 switchJdk() {
8b245298349a zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
6 local jdkName="$1"
153
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
7 local new_path=$(removeFromPath "jdk")
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
8 export JAVA_HOME=$(/usr/bin/java-config-2 --select-vm=${jdkName} -O)
0
8b245298349a zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
9 export JAVAC=${JAVA_HOME}/bin/javac
8b245298349a zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
10 export JDK_HOME=${JAVA_HOME}
8b245298349a zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
11 export PATH="${JAVA_HOME}/bin":"${new_path}"
8b245298349a zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
12 java -version
8b245298349a zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
13 }
8b245298349a zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
14
48
47174e41b448 add a switch for Java 8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 0
diff changeset
15 jdk8() {
47174e41b448 add a switch for Java 8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 0
diff changeset
16 switchJdk "oracle-jdk-bin-1.8"
47174e41b448 add a switch for Java 8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 0
diff changeset
17 }
131
e72a98823522 update the jdk support module
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 48
diff changeset
18
153
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
19 openjdk8() {
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
20 export JAVA_HOME=/opt/openjdk-bin-8.202_p08
132
7f20ec5f5726 bugfix for the PATH generation when switching JDKs
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 131
diff changeset
21
153
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
22 local new_path=$(removeFromPath "jdk")
131
e72a98823522 update the jdk support module
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 48
diff changeset
23 export PATH="${JAVA_HOME}/bin":"${new_path}"
e72a98823522 update the jdk support module
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 48
diff changeset
24 java -version
135
3dd5b3b873aa jdk9 is gone, hello jdk10
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 132
diff changeset
25 }
153
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
26
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
27 openjdk11() {
154
c78e098abad3 update path to openjdk 11
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 153
diff changeset
28 export JAVA_HOME=/opt/openjdk-bin-11.0.3_p7
153
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
29
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
30 local new_path=$(removeFromPath "jdk")
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
31 export PATH="${JAVA_HOME}/bin":"${new_path}"
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
32 java -version
aa8f422d55ae add openjdk8
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 152
diff changeset
33 }
155
1a9d4664aafb add openjdk12
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 154
diff changeset
34
1a9d4664aafb add openjdk12
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 154
diff changeset
35 openjdk12() {
1a9d4664aafb add openjdk12
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 154
diff changeset
36 export JAVA_HOME=/opt/openjdk-bin-12.0.1_p12
1a9d4664aafb add openjdk12
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 154
diff changeset
37
1a9d4664aafb add openjdk12
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 154
diff changeset
38 local new_path=$(removeFromPath "jdk")
1a9d4664aafb add openjdk12
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 154
diff changeset
39 export PATH="${JAVA_HOME}/bin":"${new_path}"
1a9d4664aafb add openjdk12
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 154
diff changeset
40 java -version
1a9d4664aafb add openjdk12
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 154
diff changeset
41 }