Install java environment under linux

 

 

1. Step 1: Execute the rpm -qa|grep jdk command to view the current jdk situation.

Results of the:

java-1.8.0-openjdk-1.8.0.65-3.b17.el7.x86_64
java-1.7.0-openjdk-headless-1.7.0.91-2.6.2.3.el7.x86_64
java-1.8.0-openjdk-headless-1.8.0.65-3.b17.el7.x86_64
java-1.7.0-openjdk-1.7.0.91-2.6.2.3.el7.x86_64
[root@localhost /]# yum -y remove Java java-1.7.0-openjdk*

 2. Step 2: Execute yum -y remove  Java  java-1.7.0-openjdk* to uninstall openjdk,

In the process of executing this command, some software that has dependencies on openJDK will be uninstalled and deleted.

Don't worry, it doesn't matter. (do two uninstalls 1.7 and 1.8);

 

 jdk installation:

1. Download jdk

2. Create a new java directory under usr/local to decompress the installation package

 tar -zxvf jdk-8u121-linux-x64.tar.gz

3. Environment variable configuration

  vi /etc/profile

   export JAVA_HOME=/usr/java/jdk1.8.0_111

   export PATH=$JAVA_HOME/bin:$PATH

   export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

4. Environment variables take effect

  source profile

 

 

maven install:

1. Download

Official download address:  maven_download , the latest version of  apache-maven-3.0.5-bin.tar.gz

Official address:  maven

2. Unzip

tar zxvf apache-maven-3.0.5-bin.tar.gz (for example, the installation directory is: /home/homer/Apache-maven/apache-maven-3.0.5)

3. Installation

1) Edit /etc/profile

sudo vi /etc/profile

2) Configuration

Configure the maven installation directory:

export  MAVEN_HOME =/home/homer/Apache-maven/apache-maven-3.0.5 // installation directory

 

export PATH=${MAVEN_HOME}/bin:${PATH}

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326611467&siteId=291194637