From 9b597cad31ccfb6f13a3c10c7a7090b37174138b Mon Sep 17 00:00:00 2001 From: 8ga Date: Fri, 10 Jan 2025 13:41:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20ubuntu-jdk8.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ubuntu-jdk8.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ubuntu-jdk8.sh b/ubuntu-jdk8.sh index 6ca0b8b..7852b51 100644 --- a/ubuntu-jdk8.sh +++ b/ubuntu-jdk8.sh @@ -1,3 +1,15 @@ +#!/bin/bash + cd /usr/local + wget https://mirrors.huaweicloud.com/java/jdk/8u202-b08/jdk-8u202-linux-x64.tar.gz -tar -zvxf jdk-8u202-linux-x64.tar.gz \ No newline at end of file + +tar -zvxf jdk-8u202-linux-x64.tar.gz + +echo "export JAVA_HOME=/usr/local/jdk1.8.0_202" | tee -a /etc/profile +echo "export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/" | tee -a /etc/profile +echo "export PATH=$PATH:$JAVA_HOME/bin" | tee -a /etc/profile + +source /etc/profile + +java -version \ No newline at end of file