linux-tutorial/codes/deploy/tool/jdk/install-jdk8.sh

16 lines
341 B
Bash
Raw Normal View History

2018-02-01 16:34:02 +08:00
#!/bin/bash
2018-02-01 17:47:13 +08:00
echo -e "\n>>>>>>>>> install jdk8"
2018-02-01 17:36:03 +08:00
yum -y install java-1.8.0-openjdk-devel-debug.x86_64
2018-02-01 16:34:02 +08:00
2018-02-01 17:36:03 +08:00
cat >/etc/profile.d/jdk.sh<<EOF
JAVA_HOME=/usr/lib/jvm/java
PATH=${JAVA_HOME}/bin:\$PATH
2018-02-01 16:34:02 +08:00
CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
EOF
2018-02-01 17:36:03 +08:00
chown root.root /etc/profile.d/jdk.sh