Configure the Eclipse-based JAVA Development Environment on Ubuntu

Source: Internet
Author: User
Tags gtk
1, in Ubuntu, the Ubuntu release package JDK, so there are two ways to install JAVA Development Toolkit JDK :( 1) install with apt-get command: sudoapt-getinstallsun-java6-jdk (2) use SynapticGUI to install the sun-java6-jdk package to install JDK :&

1. In Ubuntu, JDK is packaged in the Ubuntu release, so there are two ways to install the JAVA Development Toolkit JDK:
(1) Use the apt-get command to install:
Sudo apt-get install sun-java6-jdk
(2) Using Synaptic GUI to install the sun-java6-jdk package to install JDK:
System --> Synaptic Package Manager --> check java-common, java-package --> mark for installation --> Apply.
After the installation is complete, information about the successful installation is displayed. You can also check whether the JDK is successfully installed. Enter java-version or javac-version in shell to check whether the installation is successful. If there is any information, the installation is successful.

2. After installing JDK, add the jdk/bin directory to the execution path:
In linux, The Bourne Again shell is used ~ /. Bashrc file or ~ Add: export PATH =/usr/local/jdk6/bin: $ PATH at the end of the/. bash_profile file.
Execution path ---- search for the directory list of local executable files in the operating system
Similar to the environment variables set in the global region cache area in windows, save the settings and open any control window with the correct path.

3. Configure the JRE Environment (JRE is a java runtime environment that includes virtual machines but does not contain compilers)
Run the following command in shell:
Sudo update-alternatives-config java configures the Eclipse-based JAVA Development Environment on Ubuntu:
Two or more paths are usually provided.
Select/usr/lib/jvm/java-1.6.0-sun/jre/java as your JRE

4, In addition, you can install the browser java Plug-In: sudo apt-get install sun-java6-plugin

5. Go to http://www.eclipse.org/downloadsto download the eclipse.
Eclipse-SDK-3.7-linux-gtk.tar.gz

6. Place the eclipse-sdk-3.7-linux-gtk.tar.gz file under the/opt directory and run the mv _ statement as root to move it to the opt directory ).

7, enter the/opt directory, execute tar-zxvf eclipse-SDK-3.7-linux-gtk.tar.gz, decompress the file

8. In shell, go to the eclipse Directory: cd/opt/eclipse
And set the execution permission for the file eclipse User: chown-R root: User Name eclipse
Alternatively, run sudo chown-R eclipse directly.

9. Create a desktop connection: Create a. desktop file to establish a connection between the application and the desktop.
Sudo gedit/usr/share/applications/eclipse. desktop
Add the following content to the gedit interface:
[Desktop Entry]
Type = Application
Name = Eclipse
Comment = Eclipse Integrated Development Environment
Icon = eclipse
Exec = eclipse
Terminal = false
Categories = Development; IDE; Java;

Then, you can directly start the eclipse program through charts on the desktop:
Applications --> programming --> Eclipse

10. Create the first java program project:
Eclipse --> file --> select a folder for "workspace" --> OK --> File --> new --> project name --> next --> finish

Current problems:
1. When JDK is installed, JDK has been detected and installed successfully, but the corresponding jdk/bindirectory cannot be found, and the source file src.zipand corresponding file jdk-version-doc.zip of JDK cannot be found. Generally, you need to decompress the source code file and the corresponding document file, and add the jdk/bin directory to the execution path, but it cannot be completed at present.
It is strange that java and javac can be used normally at present, and there are many jar packages in/usr/share/java.
Download jdk Source Code address: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u27-download-440405.html online
However, use chmod + x jdk. bin
./Jdk. bin
Command, the installation fails.

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.