Linux System Environment Setup

Source: Internet
Author: User

First, install JDK reference post

Installing JDK with Yum (CentOS)

1. See which JDK versions are available in the Yum Library

12345678910111213141516171819 [[email protected] ~]# yum search java|grep jdkldapjdk-javadoc.x86_64 : Javadoc forldapjdkjava-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environmentjava-1.6.0-openjdk-demo.x86_64 : OpenJDK Demosjava-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environmentjava-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentationjava-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundlejava-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environmentjava-1.7.0-openjdk-demo.x86_64 : OpenJDK Demosjava-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environmentjava-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentationjava-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundlejava-1.8.0-openjdk.x86_64 : OpenJDK Runtime Environmentjava-1.8.0-openjdk-demo.x86_64 : OpenJDK Demosjava-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environmentjava-1.8.0-openjdk-headless.x86_64 : OpenJDK Runtime Environmentjava-1.8.0-openjdk-javadoc.noarch : OpenJDK API Documentationjava-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundleldapjdk.x86_64 : The Mozilla LDAP Java SDK

2. Select a version to install

We install the 1.7 version here

1 [[email protected] ~]# yum install java-1.7.0-openjdk

After the installation is complete, the default installation directory is:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75.x86_64

3. Setting Environment variables

1 [[email protected] ~]# vi /etc/profile

Add the following content:

123456 #set java environmentJAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75.x86_64JRE_HOME=$JAVA_HOME/jreCLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/libPATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/binexportJAVA_HOME JRE_HOME CLASS_PATH PATH

Let the changes take effect:

1 [[email protected] java]# source /etc/profile

3. Verification

Ditto.

Note: Due to the use of Yum to install the JDK, the system takes into account multiple versions of the problem, it will be version control with alternatives. Initially, the corresponding version of the JDK is installed in the/usr/lib/jvm/and will be registered in the alternatives, and in the/etc/alternatives directory will produce some links to the newly installed JDK version in/usr/lib/jvm/.

Below the/usr/bin there will be a corresponding file linked to/etc/alternatives. For example,/usr/bin will have a link file below the Java mapping relationship as follows:

12 /usr/bin/java->/etc/alternatives/java/etc/alternatives/java-/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

This allows the Java command to function without setting the environment variable. However, if you want to set environment variables for Tomcat or other software.

Similarly, if a new version of the JDK is installed, it will be re-linked to the latest installed JDK version. Of course, you can also use alternatives to modify the version you want to use.

Specific methods can be referenced: "Using Linux alternatives to manage multiple versions of software"

Second, install port view command to see which ports occupy

Yum Install wget

Yum Install Net-tools

Third, Port view

NETSTAT-APN, view all process and port usage

Netstat-apn|grep 8080 See the specific port number

Four, the firewall problem immediately effective, restart after the failure

need to install Yum Install iptables-services in order to use iptables Viewing Firewalls

Status View: Service iptables status
Open: Service iptables start
Close: Service iptables stop

Linux System Environment Setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.