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