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

14 lines
305 B
Bash

#!/bin/bash
yum -y install java-1.8.0-openjdk-devel-debug.x86_64
cat >/etc/profile.d/jdk.sh<<EOF
JAVA_HOME=/usr/lib/jvm/java
PATH=${JAVA_HOME}/bin:\$PATH
CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
EOF
chown root.root /etc/profile.d/jdk.sh