Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to install jdk1.7.0_79 in binary system with CentOS6.5 tar.gz

Shulou Source: shulou.com Published: 2022-06-01 02:41:53 09月22日 Update

This article is to share with you about CentOS6.5 tar.gz how to install jdk1.7.0_79 in binary system, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it.

To apply for a new Huawei cloud machine, install JDK7 for binary files:

1. Check whether JDK is installed on this machine.

2. Uninstall the installed JDK

View installed JDK packages

[root@csxf java] # rpm-qa | grep jdk

Delete installed JDK (can not be deleted, pay attention to environment variables)

[root@csxf java] # rpm-e java-1.6.0-openjdk-1.6.0.41-1.13.13.1.el6_8.x86_64

[root@csxf java] # rpm-e java-1.7.0-openjdk-1.7.0.161-2.6.12.0.el6_9.x86_64

3. Download the tar.gz binary installation package of JDK to the / usr/java directory

[root@csxf java] # cd / usr/java/

[root@csxf java] # ll

-rw-r--r-- 1 root root 153512879 Jun 23 2016 jdk-7u79-linux-x64.tar.gz

Extract the tar.gz binary file

[root@csxf java] # tar-xzvf jdk-7u79-linux-x64.tar.gz

4. Set environment variables

[root@csxf jdk1.7.0_79] # vim / etc/profile

Add trailing line (G):

Export JAVA_HOME=/usr/java/jdk1.7.0_79

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

Export PATH=$JAVA_HOME/bin:$PATH

Make the configuration effective after editing

[root@csxf jdk1.7.0_79] # source / etc/profile

5. Check whether the installation is successful

[root@csxf java] # echo $PATH

[root@csxf jdk1.7.0_79] # java-version

Note:

1. Export PATH=$JAVA_HOME/bin:$PATH, pay attention to putting $PATH at the end. To avoid problems with the old and new versions (the new installation of JDK can overwrite the original installation)

The above is how CentOS6.5 tar.gz carries on the binary installation jdk1.7.0_79, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Tags: Binaries variables files more environment knowledge articles checks utility success that is trailing work meetings articles old and new machines steps versions directories look Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information macOS Shulou Tech Info Huawei Shulou Technology