Configure the Java + Eclipse + MyEclipse development environment in Ubuntu

Source: Internet
Author: User
Ubuntu configures the Java + Eclipse + MyEclipse development environment-general Linux technology-Linux programming and kernel information. The following is a detailed description. 1. Configure the JAVA environment for Ubuntu

Operating system version: Ubuntu 7.10 Gutsy
JAVA version: JAVA 6

Installing the Java Virtual Machine and SDK in Ubuntu is very easy:
Enter commands on the terminal when connected
$ Sudo apt-get install sun-java6-jre sun-java6-sdk
This command can help you download and install JAVA 6. By the way, you can install JAVA support in the browser:
$ Sudo apt-get install sun-java6-plugin
After installing the three variables, you need to write the system variables:
$ Sudo gedit/etc/environment
Write the following two lines in the Text Editor:

CLASSPATH =.:/usr/lib/jvm/java-6-sun/lib
JAVA_HOME =/usr/lib/jvm/java-6-sun

We also need to adjust the priority of system virtual machines:
$ Sudo gedit/etc/jvm
Write the following sentence at the top of the Text Editor:

/Usr/lib/jvm/java-6-sun


Enter the following command in the terminal:
$ Java-version
The terminal should return the following words:
Java version "1.6.0 _ 03"
Java (TM) SE Runtime Environment (build 1.6.0 _ 03-b05)
Java HotSpot (TM) Server VM (build 1.6.0 _ 03-b05, mixed mode)

This indicates that the JAVA environment has been established. You can use a text editor to write a JAVA HelloWorld! The program executes javac compilation and java to explain the execution and see the result.

Ii. install and configure Eclipse + MyEclipse

Eclipse is an open-source and free software development tool (IDE). It is a JAVA-based scalable development platform. To be precise, Eclipse provides a framework and a set of services, eclipse's open scalability enables Eclipse to have a large number of plug-ins to expand the development capabilities and functions of Eclipse, not limited to JAVA development. Therefore, although Eclipse is written in JAVA, it can be used not only for JAVA development, but also for C/C ++ and other language development, as long as you install the corresponding plug-ins to expand. Eclipse was initially a development framework donated by IBM to the open-source community. The IBM Development Technology website contains a large amount of technical information about Eclipse:
Http://www.ibm.com/developerworks/cn/eclipse/
MyEclipse is used to expand Eclipse's J2EE development function. Therefore, many people install MyEclipse when using Eclipse. MyEclipse is also a plug-in of Eclipse.
This is the introduction to Eclipse and MyEclipse. The body begins:
First, create a directory in your main folder (/home/[your name]) to store Eclipse, on shixinyu my machine, a JAVA directory is created under/home/shixinyu.
Go to the Eclipse official website to download Eclipse. The latest version is 3.3.1.1:
Http://www.eclipse.org/downloads/
Shixinyu I downloaded the Eclipse Classic 3.3.1.1 version.
After downloading the downloaded compressed file, you can directly decompress its folder eclipse to/home/[your name]/JAVA, and double-click to execute eclipse
Next, download MyEclipse:
Http://www.myeclipseide.com/module-htmlpages-display-pid-4.html
You need to download the version of MyEclipse 3.3 GA that matches Eclipse 6.0. Note that MyEclipse is a commercial software and can only be used for free for 30 days, you must submit the subscription code 30 days later to continue using it. The authorization fee is $32 for the Standard Edition and $53 for the Professional Edition. If you are interested and are willing to pay for it, please purchase the authorization. Otherwise, please handle it yourself if you want to continue using it.
After downloading MyEclipse, we get. bin file, open the terminal, and run the cd command to enter the directory where the MyEclipse Installation File is located. For example, if shixinyu is stored in/home/shixinyu/Downlads, enter the command:
$ Cd/home/shixinyu/Downloads
Then enter the command:
$ Sudo sh MyEclipse_6_0_1GA_E3_3_1_Installer.bin
Then a GUI installation program is started, as shown in:


(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // response); ">

Click "Next" and select "I accept...":


(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // response); ">

Select the directory where Eclipse is located and click "Choose". For shixinyu, select "/home/shixinyu/JAVA/eclipse":


(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // response); ">

Next, select the installation location of MyEclipse. I chose "/home/shixinyu/JAVA/MyEclipse" here (the MyEclipse directory has been created in advance ):


(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // response); ">

Next, select Link Folder to retain the default option:


(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // response); ">

Next, you can Install it. Click the "Install" button:


(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // response); ">

After installation, go to/home/shixinyu/JAVA/eclipse and double-click eclipse to automatically identify MyEclipse. Do you want to create a menu in "application?
Run the following command on the terminal:
$ Sudo gedit/usr/share/applications/Eclipse. desktop
Copy and paste the following content in the text editor

[Desktop Entry]
Name = Eclipse
Comment = Eclipse IDE
Exec =/home/shixinyu/JAVA/eclipse
Icon =/home/shixinyu/JAVA/eclipse/icon. xpm
Terminal = false
Type = Application
Categories = Application; Development;

After saving this file, the Eclipse shortcut appears in "programming" under "application.

You can create a project in Eclipse and create a Class to write a HelloWorld! Test the program.
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.