Linux | Will JDK be played under CentOS7? you sure?

How to build a Java environment under Linux

Software Environment

Virtual machine: VMware Workstation

System: Linux: CentOS-7-x86_64

tool:

Installation tool: SSH client

Construction steps

1 : Query the current system version

cat  /proc/version

2 : First confirm whether the current system already has a java environment

java -version

3 :Check if the JDK installation package exists in the current system

rpm -qa | grep java

4 : If not, enter the /opt directory, create a new folder java7, and then enter the java7 folder

cd /opt
mkdir java7
cd java7

5 : Download jdk7 online in the java7 directory

wget http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz

6 : Unzip the current file to the folder

tar -zvxf jdk-7u79-linux-x64.tar.gz

7 : Configure environment variables

vi ~/.bash_profile

Enter the following:
export JAVA_HOME=/opt/java7/jdk1.7.0_79
export CLASSPATH=$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export PATH=$PATH:$JAVA_HOME/bin

8 : Make the configuration file effective

source ~/.bash_profile 

9 : View the JDK version after installation

java -version

Recommended Posts

Linux | Will JDK be played under CentOS7? you sure?
Linux Centos7 install jdk1.8
Centos 7 install JDK (Linux install jdk)
3 partitioning tools under CentOS Linux
Install MySQL under Linux (CentOS 7)
Install Java JDK8 under CentOS6
CentOS 6.8 under linux install mongodb
Linux CentOS 7 install JDK detailed steps
Install mysql8.0.13 version under Linux CentOS7 system
Graphical tutorial for installing JDK1.8 under CentOS7.4
Three ways to install JDK under CentOS
Linux Mint 19 will be based on Ubuntu 18.04 LTS