Mercurial > hg > zsh-env
annotate zshrc-jdk @ 162:0bd8976bd5fb
add default aliases for gk and removeKernel
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Thu, 09 Jan 2020 13:03:20 +0100 |
parents | 2f71ba394858 |
children | 6dd02b1ebb80 |
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") |
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 | 15 jdk8() { |
16 switchJdk "oracle-jdk-bin-1.8" | |
17 } | |
131
e72a98823522
update the jdk support module
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
18 |
153 | 19 openjdk8() { |
156 | 20 export JAVA_HOME=/opt/openjdk-bin-8.222_p10 |
153 | 21 |
22 local new_path=$(removeFromPath "jdk") | |
23 export PATH="${JAVA_HOME}/bin":"${new_path}" | |
24 java -version | |
25 } | |
155 | 26 |
27 openjdk12() { | |
156 | 28 switchJdk "openjdk-bin-12" |
29 } | |
155 | 30 |
156 | 31 openjdk13() { |
32 switchJdk "openjdk-bin-13" | |
155 | 33 } |