1. Install the Java environment and configuration method 1: 1. Open the terminal, execute the command, install jre and jdk: $ sudoapt-getinstallsun-java6-jre; $ sudoapt-getinstallsun-java6-jdk; 2. Set the current default java interpreter: after sudoupdate-alternatives-configjava is executed, select a row containing "sun ".
1. Install the Java environment and Configuration
Method 1:
1. Open the terminal, execute the command, and install jre and jdk:
- $sudoapt-getinstallsun-java6-jre;
- $sudoapt-getinstallsun-java6-jdk;
2. Set the current default java interpreter:
- sudoupdate-alternatives-configjava
After the command is executed, select the number in front of the row containing "sun" and press enter to confirm.
3. Configure Environment Variables
- $sudogedit/etc/environment
Add two rows:
- CLASSPATH=/usr/lib/jvm/java-1.5.0-sun/lib
- JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
Method 2:
1. First, check whether the software required for the rpm package is installed. Run the following command on the Terminal:
$ Rpm-q-a // View
Run the software required to install rpm:
$ Sudoapt-getinstallrpm
2. Download jdk Installation Software: (you can go to the sun Website: http://java.sun.com) to the user folder.
3. Install jdk software:
In Terminal, enter./jdk software name. bin. If the Protocol appears, select agree to press y and press enter to start installation. After installation, the folder name is jdk1.6.0 _ 01.
4. Create a JDK Link
- $ln-sjdk1.6.0.0_01jdk