File tree Expand file tree Collapse file tree 2 files changed +25
-16
lines changed Expand file tree Collapse file tree 2 files changed +25
-16
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,18 @@ mv jdk1.8.0_151/ /usr/local/
26
26
27
27
echo " JDK 写入系统变量到 zshrc"
28
28
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
+
37
42
38
43
echo " JDK 设置完成,需要你手动设置:source ~/.zshrc"
Original file line number Diff line number Diff line change @@ -33,13 +33,17 @@ mv jdk1.8.0_151/ /usr/program/
33
33
34
34
echo " JDK 写入系统变量到 zshrc"
35
35
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
44
48
45
49
echo " JDK 设置完成,需要你手动设置:source ~/.zshrc"
You can’t perform that action at this time.
0 commit comments