annotate zshrc-jdk @ 181:f6df36a328b5

also replace the git config
author Dirk Olmes <dirk.olmes@codedo.de>
date Tue, 04 Aug 2020 11:22:16 +0200
parents 51710c7c26c2
children
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")
165
6dd02b1ebb80 use java-config again for selecting JDKs
Dirk Olmes <dirk.olmes@codedo.de>
parents: 156
diff changeset
8 export JAVA_HOME=$(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
176
d84faf4d53ac adding openjdk11
Dirk Olmes <dirk.olmes@codedo.de>
parents: 165
diff changeset
15 openjdk8() {
d84faf4d53ac adding openjdk11
Dirk Olmes <dirk.olmes@codedo.de>
parents: 165
diff changeset
16 switchJdk "openjdk-bin-8"
48
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
176
d84faf4d53ac adding openjdk11
Dirk Olmes <dirk.olmes@codedo.de>
parents: 165
diff changeset
19 openjdk11() {
d84faf4d53ac adding openjdk11
Dirk Olmes <dirk.olmes@codedo.de>
parents: 165
diff changeset
20 local new_path=$(removeFromPath "jdk")
178
51710c7c26c2 jdk 13 is superseeded by jdk 14, use the generic jdk 11 link
Dirk Olmes <dirk.olmes@codedo.de>
parents: 176
diff changeset
21 export JAVA_HOME=/opt/openjdk-bin-11
176
d84faf4d53ac adding openjdk11
Dirk Olmes <dirk.olmes@codedo.de>
parents: 165
diff changeset
22 export JAVAC=${JAVA_HOME}/bin/javac
d84faf4d53ac adding openjdk11
Dirk Olmes <dirk.olmes@codedo.de>
parents: 165
diff changeset
23 export JDK_HOME=${JAVA_HOME}
d84faf4d53ac adding openjdk11
Dirk Olmes <dirk.olmes@codedo.de>
parents: 165
diff changeset
24 export PATH="${JAVA_HOME}/bin":"${new_path}"
d84faf4d53ac adding openjdk11
Dirk Olmes <dirk.olmes@codedo.de>
parents: 165
diff changeset
25 java -version
156
2f71ba394858 update jdks
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 155
diff changeset
26 }
155
1a9d4664aafb add openjdk12
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 154
diff changeset
27
178
51710c7c26c2 jdk 13 is superseeded by jdk 14, use the generic jdk 11 link
Dirk Olmes <dirk.olmes@codedo.de>
parents: 176
diff changeset
28 openjdk14() {
51710c7c26c2 jdk 13 is superseeded by jdk 14, use the generic jdk 11 link
Dirk Olmes <dirk.olmes@codedo.de>
parents: 176
diff changeset
29 switchJdk "openjdk-bin-14"
155
1a9d4664aafb add openjdk12
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 154
diff changeset
30 }