Installing the JDK under Liunx

Source: Internet
Author: User

                                                Installing the JDK under Liunx

1. First enter the root permission command sudo su Enter the password to enter root permissions

2. Take a look at the current liunx whether there is a JDK environment, enter the command Javac, if present, will display the corresponding JDK environment content, if not present, will be prompted to find the JDK environment, the content is as follows:

      The program ' Javac ' can is found in the following packages:

* DEFAULT-JDK

* ECJ

* GCJ-4.6-JDK

* GCJ-4.7-JDK

* OPENJDK-7-JDK

* OPENJDK-6-JDK

Try:apt-get Install <selected package>

  3. So this time we start to install the JDK, the installation command is simple: apt-get install OPENJDK-7-JDK (here according to the version of the JDK you need to install their own choice)

Enter Enter to show do want to continue [y/n]?      Enter y

Start Download installation ... The installation process takes a few minutes and waits for ing ....

4. Show done.  Done. Installation complete input Javac The JDK environment prompt will indicate that the JDK installation OK

5. Of course, after the installation we have not completely finished, but also need to tell the system what directory our JDK installed, equivalent to the Windows JDK environment variable configuration

Start configuring the JDK under Iunx

Input command: Vim/etc/profile carriage return Displays the following content

        

At this point you need to start configuring the JDK environment variable in the IF ["$PS 1"]; Then enter the following:

        

        Note that the first item in the Export section is java_home= (the path here is selected based on your JDK installation directory)

Then enter the following four corresponding export

        

      OK after save exit

Then enter the command source/etc/profile effective   

    

Enter Javac everything OK

Good memory than bad writing, save this article for everyone, but also convenient to watch themselves later.

Installing the JDK under Liunx

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.