The installation configuration jdk Centos7

First, install the virtual machine Centos7

1. Go to the official website down a Centos 7.6 64-bit version of the image file, because I wanted to use this as a server virtual machine to imitate, so here is under the most streamlined mirror, the smallest image file size is less than 1G.

2. Use virtual machine image file is installed, choose the hard disk size 12G (limited hard disk resources).

3. restart the virtual machine, see the ip address of the virtual machine with ip addr, this command three entries will appear, centos ip address is inet value ens33 entry. Ens33 found no inet this property, then it can not connect to a virtual machine by IP address. Modify the configuration ens33 card, restart the network services, then ip addr to see the IP address.

4. SecrueCRT connected to the virtual machine, the connection is successful. Then rushed to the virtual machine took a photo, the future is virtual machine can recover to play bad, this virtual machine is very good, ha ha ha.

Second, the installation JDK

1. to the official website of the next 64-bit version 1.8 rpm package.

Red Hat 32 installed before extracting JDK manner, either 32-bit or 64-bit, life and death unsuccessful. Later, his teammates say Red Hat vulnerable, unzip the way is not good. Suggested that I use centos, with rpm installation.

2. FileZilla FTP Cient connected to the virtual machine and jdk rpm package (jdk-8u241-linux-x64.rpm) uploaded to the virtual machine, following start installation configuration.

//Create a directory

mkdir /usr/java

// copy the downloaded file past rpm

cp jdk-8u241-linux-x64.rpm /usr/java/

// proceed to the next rpm directory
cd / usr / java

// run the install command
rpm -ivh jdk-8u241-linux- x64.rpm

// If the lack of prompt execution permission to execute the command (using a root, No tips)
chmod + the JDK-8u241-the X-Linux-x64.rpm

// Check information java version
java -version

// configuration environment variable
vi / etc / profile

Adding at the tail

export JAVA_HOME=/usr/java/jdk1.8.0_241-amd64
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH

Then esc: wq (save and exit)

// load variables you just set the variables to take effect
source / etc / profile

 

Guess you like

Origin www.cnblogs.com/my-testing-life/p/12637496.html