Install eclipse and VE from scratch

Source: Internet
Author: User
Recently, some people have encountered many strange problems when installing visual editor. Therefore, this article is intended to be helpful to those who need it.

Start installation. (There are many installation methods. The following is only one of them)

Preparations:
1. Download JDK (JDK 5_0_09 );
2. Download eclipse (3.2.1). (I prefer the latest version ^-^)
3. Download EMF (2.2.1), GEF (3.2.1), and VE (1.2.1 );

Start installation:
1. Install JDK;
This is relatively easy, standard Windows InstallationProgram, Next, click Next. After the installation is complete, you do not need to restart.

2. Install eclipse;
Eclipse is a green software. You do not need to install it. You only need to decompress it and then run it.
For ease of instruction, I decompress it to the C root directory to get the c: \ eclipse directory and run c: \ eclipse \ eclipse.exe.
NOTE: For the following installation, you must first close the eclipse program.

3. Install EMF, GEF, and VE;
For eclipse, these are their plug-ins, so the installation methods are the same.
A. create four subdirectories under the c: \ eclipse directory:C: \ eclipse \ EMF , C: \ eclipse \ GEF , C: \ eclipse \ ve , C: \ eclipse \ links ;
B. decompress the downloaded EMF, GEF, and VE files to the corresponding directory. That is, decompress the EMF compressed package to c: \ eclipse \ EMF to obtain C: \ eclipse \ EMF \ eclipse directory, and so on, decompress GEF and VE;
C. In the c: \ eclipse \ links directory, create a text file named link.txt.
Add the following three lines of text to the link.txt file:
Path = EMF
Path = GEF
Path = ve
Note: The relative path is used here. You can also extract EMF, GEF, and ve to other places and use the absolute path.

4. After the installation is complete, run eclipse again. When started, it will automatically find all text files in the links directory and load all the plug-ins pointed to by path. Here, of course, VE is included.
A. If you are not sure whether the file has been loaded, choose help> Software Updates> Manage configuration to open the product configuration form. In the tree column on the left, you can see the loaded plug-in.
B. If the load fails, you can use eclipse-clear to run the program.

Use ve to write a hello:
1. Create a project;
File-> New-> project ..., select "Java Project", click "Next", and enter a Project name: Hello. All others are default. Press ENTER or click "finish.

2. Set the SWT library;
A. Select project hello, right-click the menu, and open the Properties dialog box.
B. Select Java build path in the tree on the left. On the settings page, select the Libraries page and click "add library ...";
C. In the open add library dialog box, select Standard Widget Toolkit (SWT) and next;
D. In the open SWT library Options dialog box, check "include support for jface library" and finish.
E. Return to the properties dialog box and click OK.

3. Create a Hellworld. Java file;
A. Select project hello, right-click the menu, choose new> other... (or click the new icon in the toolbar), open the select a wizard dialog box, and select Java/visual class and next;
B. In the open Java visual class dialog box,
In the package, enter com. cnblogs. Pan;
In name, enter helloworld;
In Style, select SWT/shell;
Check public static void main (string [] ARGs );
Finish.

4. At this step, we should be able to see the form. Those controls are all in the palette and can be seen by clicking on them.
A. Right-click the form, select set layout, and then select null (this is my habit)
B. Select a button from the palette and draw a button anywhere in the form. In the Properties window below, set the text to clickme;
C. Select this button, right-click and select events-> Add event. In the displayed dialog box, select widgetselected on the left and finish.
D. At this time, the cursor will automatically locate the corresponding position of the program. We will add the following statement to the program:

Public   Void Widgetselected (Org. Eclipse. SWT. Events. selectionevent e ){
System. Out. println ( " Widgetselected () " );

messagedialog. openinformation ( null , " Hello " , " Hello world! " ); // Add this statement
}

E. Save the program. Choose run> Run as> JAVA application. Say hello to the world!

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.