1. Uninstall the previous JDK and mark all options that contain openjdk in the new version to completely delete it. Or execute sudo apt-Get autoremove openjdk-6-jre 2, download JDK Software
Follow these steps to install Sun JDK:
Slave/
Or add a repository next week:
Sudo add-Apt-repository PPA: ferramrobert to/Java
Sudo apt-Get update
Sudo apt-Get install sun-java6-jdk sun-java6-plugin
Then, unzip and install
Bin etc games include jdk1.6.0 _ 31 jdk-6u31-linux-x64.bin lib man sbin share srcicetea @ Ubuntu:/usr/local $./jdk-6u31-linux-x64.bin
Subtitles will appear. Press enter until yes/no is required for the screen display. Enter y and press Enter. The JDK will be decompressed to the folder to get the JDK 1.6.0 _ 31 directory.
Now that JDK has been installed, configure it below
Run
Code:Sudo Vim/etc/environment
In environment, the following section appears:
Reference:
Java_home =/usr/local/jdk1.6.0 _ 31
Classpath =/usr/local/jdk1.6.0 _ 31/lib
Path = $ path: $ java_home/bin: $ classpath
Export path
At this time, the environment variables are successfully set (there are many ways to set the environment variables, not to list them one by one)
Ubuntu may have a default JDK, such as openjdk. If openjdk is available, we need to perform the following work to make JDK installed by default. 3. Configure JDK software:
Code:
Sudo Update-alternatives -- install/usr/bin/javac/usr/local/jdk1.6.0 _ 31/bin/javac 1071
Sudo Update-alternatives -- install/usr/bin/Java/usr/local/jdk1.6.0 _ 31/bin/Java 1071
Update-alternatives -- config Java
In this step, add the installed JDK to the Java menu.
Then execute
Update-alternatives -- config Java
In this step, select the default JDK
In this way, enter
Code:
Enter Java-version to display that the system uses Sun Java.
In this way, the installed JDK is automatically found when you install netbeans.
Supplement: Update-alternatives -- config javac is required to set javac.
Reference: Http://blog.csdn.net/oneyearlater/article/details/6324403
1. Uninstall the previous JDK and mark all options that contain openjdk in the new version to completely delete it. Or execute sudo apt-Get autoremove openjdk-6-jre 2, download JDK Software
Follow these steps to install Sun JDK:
Slave/
Or add a repository next week:
Sudo add-Apt-repository PPA: ferramrobert to/Java
Sudo apt-Get update
Sudo apt-Get install sun-java6-jdk sun-java6-plugin
Then, unzip and install
Bin etc games include jdk1.6.0 _ 31 jdk-6u31-linux-x64.bin lib man sbin share srcicetea @ Ubuntu:/usr/local $./jdk-6u31-linux-x64.bin
Subtitles will appear. Press enter until yes/no is required for the screen display. Enter y and press Enter. The JDK will be decompressed to the folder to get the JDK 1.6.0 _ 31 directory.
Now that JDK has been installed, configure it below
Run
Code:Sudo Vim/etc/environment
In environment, the following section appears:
Reference:
Java_home =/usr/local/jdk1.6.0 _ 31
Classpath =/usr/local/jdk1.6.0 _ 31/lib
Path = $ path: $ java_home/bin: $ classpath
Export path
At this time, the environment variables are successfully set (there are many ways to set the environment variables, not to list them one by one)
Ubuntu may have a default JDK, such as openjdk. If openjdk is available, we need to perform the following work to make JDK installed by default. 3. Configure JDK software:
Code:
Sudo Update-alternatives -- install/usr/bin/javac/usr/local/jdk1.6.0 _ 31/bin/javac 1071
Sudo Update-alternatives -- install/usr/bin/Java/usr/local/jdk1.6.0 _ 31/bin/Java 1071
Update-alternatives -- config Java
In this step, add the installed JDK to the Java menu.
Then execute
Update-alternatives -- config Java
In this step, select the default JDK
In this way, enter
Code:
Enter Java-version to display that the system uses Sun Java.
In this way, the installed JDK is automatically found when you install netbeans.
Supplement: Update-alternatives -- config javac is required to set javac.
Reference: Http://blog.csdn.net/oneyearlater/article/details/6324403