Mercurial > hg > zsh-env
annotate zshrc-jdk @ 131:e72a98823522
update the jdk support module
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Sun, 13 May 2018 13:54:32 +0200 |
parents | 47174e41b448 |
children | 7f20ec5f5726 |
rev | line source |
---|---|
0
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
1 # |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
2 # zshrc for handling different Maven versions |
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" |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
7 local new_path=`removeFromPath "jdk"` |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
8 export JAVA_HOME=`/usr/bin/java-config-2 --select-vm=${jdkName} -O` |
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 |
e72a98823522
update the jdk support module
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
19 jdk9() { |
e72a98823522
update the jdk support module
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
20 export JAVA_HOME=/opt/oracle-jdk-bin-9.0.4 |
e72a98823522
update the jdk support module
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
21 export PATH="${JAVA_HOME}/bin":"${new_path}" |
e72a98823522
update the jdk support module
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
22 java -version |
e72a98823522
update the jdk support module
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
23 } |