Configure the JDK7 environment variable and ubuntujdk7 environment variable in ubuntu

Source: Internet
Author: User

Configure the JDK7 environment variable and ubuntujdk7 environment variable in ubuntu

  • Jdk-7u55-linux-x64.tar.gz

  • Ubuntu12.04 or later versions

Method/step
  1. 1

    First, Baidu searches for jdk and selects the first website, which is Oracle Jdk. Click in

  2. 2

    Click Download to Download the jdk for linux on the official website. Bytes

  3. 3

    Create the target path folder of Java, which is placed under usr/lib/jvm. Perform the following operations on the terminal:

    $ Sudo mkdir/usr/lib/jvm

    Enter your password to complete the creation.

  4. 4

    Decompress the downloaded jdk compressed file to the directory you created. Run the following command.

    $ Sudo tar-C/usr/lib/jvm-xzf jdk-7u55-linux-x64.tar.gz

    Put your jdk file under your home page. Here I put it"Download"In the previous directory

  5. 5

    Check whether the jdk file is correctly installed in the folder you created, and view the file

  6. 6

    Check whether java is available on the local machine. The following command is used here:

    $ Sudo update-alternatives -- list java

    If an error is displayed in the graph and java is not available in the system, perform the following steps:

  7. 7

    Environment variable configuration command:

    $ Sudo gedit ~ /. Bashrc

    Add the following code:

    Export JAVA_HOME =/usr/lib/jvm/jdk1.7.0 _ 55

    Export JRE_HOME =$ {JAVA_HOME}/jre

    Export CLASSPATH =. :$ {JAVA_HOME}/lib :$ {JRE_HOME}/lib

    Export PATH =$ {JAVA_HOME}/bin: $ PATH

  8. 8

    Check whether the configuration is successful: java-version

    Information is configured successfully!

    END
Notes
  • Other methods are available for jdk configuration.

  • If you think it's good, just give it a compliment.

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.