Java environment and eclipse Environment

Source: Internet
Author: User

Java

Open the terminal, run the following command, or use Adept/new software manager, where search for "sun-java6-jre" and "sun-java6-jdk" and tag the installation.

Sudo apt-get install sun-java6-jre

If the space is rich, we recommend that you install a JDK. Sudo apt-get install sun-java6-jd

Tip: During the installation process, you need to answer whether you agree to use the Protocol (the red-blue prompt page in the terminal). Press the tab key to OK, and press enter to install it normally.

Full installation is: sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-demo sun-java6-doc sun-java6-source sun-java6-plugin ia32-sun-java6-plugin libmyodbc-postgresql libct1

Set the current defaultJavaInterpreter:

sudo update-alternatives --config java

The following figure is displayed after execution:

There are 2 alternatives which provide `java'. Selection Alternative --------------------------------------------- 1/usr/bin/gij-wrapper-4.1*+ 2 /usr/lib/jvm/java-6-sun/jre/bin/java Press enter to keep the default[*], or type selection number:

Enter the number before the row containing "sun. As shown above, enter 2 and press enter to confirm.

ConfigurationJAVAEnvironment Variable:

Add the following two lines to sudo gedit/etc/environment: CLASSPATH =.: /usr/lib/jvm/java-6-sun/lib JAVA_HOME =/usr/lib/jvm/java-6-sun sudo gedit/etc/jvm/ enter the lib/jvm/java-6-sun line at the top of the configuration block.

InstallJava Plugin(Optional ):

Sudo apt-get install sun-java6-plugin

Eclipse
Here, I like to download J2EE. Http://www.eclipse.org/downloads/
1. decompress the file to the/usr/local/sudo tar-xzvf eclipse compressed package/usr/local/, but I cannot use the above command. I don't know why.
Run the sudo tar-xzvf eclipse compressed package step by step.
Then decompress the sudo MV eclipse Folder/usr/local/
2. Add eclipse to the programming under the desktop menu application and create it in/usr/share/applications.
eclipse.desktop
[Desktop Entry]
Name = eclipse comment = eclipse Development
Exec=/usr/local/eclipse/eclipse
Icon=/usr/local/eclipse/icon.xpm
Terminal=false Type=Application
Categories=GNOME;GTK;Application;Development;

Bugs Report: There are still a lot of buckets on Linux. When eclipse adds Tomcat servers, it will always be deleted after it is added.
When you add the value again, the following error is always reported: cannot create a server using the selected type:
I plan to install tomcat6.0 first, but I reported the error when I first added it. I have been doing this for a long time (including adding the tomcatplugin plug-in ),
It may be because eclipse does not support tomcat6.0. Therefore, if version 5.5 is installed, it can be successfully installed and started, but cannot be started later,
So I deleted it and added it again, but this time I reported the error. Since then, I think this is a Bugs of eclipse and it should be after the Tomcat integration.
There will be garbage left during re-integration, but I don't know how to solve it. (Later, I found that you only need to delete the. Meta folder under workspace,
You can reinstall and integrate tomcat)

Tomcat installation:

You can install apt, But I downloaded the green version and downloaded it on the tomcat homepage.

Place it in any location. Note that the/root/. bashrc and ~ /. Under bashrc, both export JAVA_HOME = "/usr/lib/jvm/java-6-sun" is configured according to your own java situation.

If the problem persists, enter the above sentence at the end of the/etc/profile file.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.