Mercurial > hg > zsh-env
annotate zshrc-jdk @ 176:d84faf4d53ac
adding openjdk11
author | Dirk Olmes <dirk.olmes@codedo.de> |
---|---|
date | Fri, 15 May 2020 13:13:18 +0200 |
parents | 6dd02b1ebb80 |
children | 51710c7c26c2 |
rev | line source |
---|---|
0
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
1 # |
152 | 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 | 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 | 15 openjdk8() { |
16 switchJdk "openjdk-bin-8" | |
48 | 17 } |
131
e72a98823522
update the jdk support module
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
18 |
176 | 19 openjdk11() { |
20 local new_path=$(removeFromPath "jdk") | |
21 export JAVA_HOME=/opt/openjdk-bin-11.0.7_p10 | |
22 export JAVAC=${JAVA_HOME}/bin/javac | |
23 export JDK_HOME=${JAVA_HOME} | |
24 export PATH="${JAVA_HOME}/bin":"${new_path}" | |
25 java -version | |
156 | 26 } |
155 | 27 |
156 | 28 openjdk13() { |
29 switchJdk "openjdk-bin-13" | |
155 | 30 } |