I believe most people will configure Eclipse in Windows. So, what about replacing the system with Ubuntu?
I found that the default Jdk in Ubuntu is Openjdk. I don't know if it was automatically installed with apt-get. As a result, the development in Eclipse is greatly unsuitable because the standard Jdk is used in the past.
1)
Query java version terminal input: java-version
So how to configure your Ubuntu and Jdk?
First, www.sun.com, download the Linux JDK, I download this JDK: jdk-7u3-linux-i586.tar.gz.
Decompress tar zxvf jdk-7u3-linux-i586.tar.gz
Modify system environment variables
- Sudo vi/etc/environment
-
- PATH = "/home /... /Download/jdk1.7.0 _ 03/bin"
-
- CLASSPATH = "/home /... /Download/jdk1.7.0 _ 03/lib"
-
- JAVA_HOME = "/home /... /Download/jdk1.7.0 _ 03 /"
At this point, if your UBUNTU has not installed Openjdk, you can skip the following text.
2 optional)
Let's modify Jdk and enter the following code:
- Sudo update-alternatives-install/usr/bin/java/home /... /Download/jdk1.7.0 _ 03/bin/java 300
-
- Sudo update-alternatives-install/usr/bin/javac/home /... /Download/jdk1.7.0 _ 03bin/javac 300
Statement: where... Represents my working directory
Select the system default Jdk
- update-alternatives –config java
After the selection, let's check the downloaded java version.
- java -version
-
- java version “1.7.0_03″
-
- Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
-
- Java HotSpot(TM) Server VM (build 22.1-b02, mixed mode)
3)
Of course, we must first download the Linux version of Eclipse. Http://www.eclipse.org/downloads/, download and directly decompress it.
Another way is to enter sudo apt-get install eclipse in the terminal.
Now that jdk has been configured, configure Eclipse
Select
Add your JDK to the right of Window-perferences-java-installed JRES
OK, you are done !!!
Go in and have a look.