CentOS 6.7 installation and configuration of JDK on the system

  • 2020-05-13 04:24:37
  • OfStack

preface

This paper mainly records the process of installing JDK7 in CentOS 6.7 system. Let's take a look at it.

The method is as follows:

1. Download the latest JDK installation package from the Oracle official website, and download the rpm package for the convenience of installation

http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. Perform installation on the server side


sudo rpm -ivh / directory /jdk-7-linux-x64.rpm

3. Set environment variables

Here we need to find the profile file and add the environment variable:


#vim /etc/profile

Append the following information to the profile file:


export JAVA_HOME=/usr/java/jdk1.7.0
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

Save exit, execute:


#source /etc/profile

conclusion

The above is the whole content of this article, I hope the content of this article to your study or work can bring 1 definite help, if you have questions you can leave a message to communicate.


Related articles: