Install Java and Eclipse on UbuntuLinux-general Linux technology-Linux programming and kernel information. For details, refer to the following section. During Ubuntu installation, Java of the GNU version will be installed at the same time, just like in most Linux releases. This Java is too practical, especially for developers, it is not very useful. Installing SUN Java in Ubuntu is very easy. Step 1:
Sudo apt-get install sun-java5-jdk
After the installation is complete, select the default java:
Sudo update-alternatives -- config java
Then configure the environment variable:
Sudo vim/etc/environment
Add the following two lines:
CLASSPATH =/usr/lib/jvm/java-1.5.0-sun/lib
JAVA_HOME =/usr/lib/jvm/java-1.5.0-sun
Save and exit.
Install and configure Eclipse. Installation is simple:
Sudo apt-get install eclipse
Although the newly installed java has become the default jvm of the system, Eclipse does not use the jvm set by update-alternative to start itself. Instead, it uses the previous GNU Java. GNU Java is an implementation of 1.4.2, and its performance is far inferior to that of SUN. To enable Eclipse to start with SUN Java, we need to continue the configuration. First, set SUN Java to the default JDK:
Sudo update-java-alternatives-s java-1.5.0-sun
Then edit the JVM configuration file:
Sudo vim/etc/jvm
Convert
/Usr/lib/jvm/java-1.5.0-sun
This line moves to the top of the configuration block. Because Eclipse ignores Ubuntu's general Java settings (which looks like a bug), we need to edit the java_home file of Eclipse:
Sudo vim/etc/eclipse/java_home
As above
/Usr/lib/jvm/java-1.5.0-sun
This line moves to the top of the file.
After all the installation and configuration are completed, the Java Development Platform of Ubuntu is basically complete.
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.