Skip to content

Commit d7d5b95

Browse files
committed
2018-04-10 补充 Showdoc
1 parent 3778f9e commit d7d5b95

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

favorite-file/shell/install_jdk_offline.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,18 @@ mv jdk1.8.0_151/ /usr/local/
2626

2727
echo "JDK 写入系统变量到 zshrc"
2828

29-
echo 'JAVA_HOME=/usr/local/jdk1.8.0_151' >> ~/.zshrc
30-
echo 'JRE_HOME=$JAVA_HOME/jre' >> ~/.zshrc
31-
echo 'PATH=$PATH:$JAVA_HOME/bin' >> ~/.zshrc
32-
echo 'CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar' >> ~/.zshrc
33-
echo 'export JAVA_HOME' >> ~/.zshrc
34-
echo 'export JRE_HOME' >> ~/.zshrc
35-
echo 'export PATH' >> ~/.zshrc
36-
echo 'export CLASSPATH' >> ~/.zshrc
29+
cat << EOF >> ~/.zshrc
30+
31+
# JDK
32+
JAVA_HOME=/usr/local/jdk1.8.0_151
33+
JRE_HOME=\$JAVA_HOME/jre
34+
PATH=\$PATH:\$JAVA_HOME/bin
35+
CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
36+
export JAVA_HOME
37+
export JRE_HOME
38+
export PATH
39+
export CLASSPATH
40+
EOF
41+
3742

3843
echo "JDK 设置完成,需要你手动设置:source ~/.zshrc"

favorite-file/shell/install_jdk_online.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ mv jdk1.8.0_151/ /usr/program/
3333

3434
echo "JDK 写入系统变量到 zshrc"
3535

36-
echo 'JAVA_HOME=/usr/program/jdk1.8.0_151' >> ~/.zshrc
37-
echo 'JRE_HOME=$JAVA_HOME/jre' >> ~/.zshrc
38-
echo 'PATH=$PATH:$JAVA_HOME/bin' >> ~/.zshrc
39-
echo 'CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar' >> ~/.zshrc
40-
echo 'export JAVA_HOME' >> ~/.zshrc
41-
echo 'export JRE_HOME' >> ~/.zshrc
42-
echo 'export PATH' >> ~/.zshrc
43-
echo 'export CLASSPATH' >> ~/.zshrc
36+
cat << EOF >> ~/.zshrc
37+
38+
# JDK
39+
JAVA_HOME=/usr/local/jdk1.8.0_151
40+
JRE_HOME=\$JAVA_HOME/jre
41+
PATH=\$PATH:\$JAVA_HOME/bin
42+
CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
43+
export JAVA_HOME
44+
export JRE_HOME
45+
export PATH
46+
export CLASSPATH
47+
EOF
4448

4549
echo "JDK 设置完成,需要你手动设置:source ~/.zshrc"

0 commit comments

Comments
 (0)