logo back up home forward   further reading more topics »

Editing Source Code with Eclipse

About Eclipse

Eclipse is an open source IDE or tools platform.

IBM released its own source code into the project in 2001 and set up a consortium to run the project. In Febuary 2004 it became an independant not for profit corporation called the Eclipse Foundation.

It is written in Java but uses its own GUI framework SWT instead of Swing. It does allow users applications to be created with either SWT or Swing. SWT is uses native calls to the operating system instead of emulating the controls in the GUI library as Swing does. Also Swing uses the MVC Model View Controller model wheras SWT uses a more direct, lower level, API.

Eclipse consists of a general purpose platform which is very extendable by adding plugins. So it can be used as a Java development system, or C++, or PHP, or it could be anything else if you write the plugins for it.

Installing Eclipse

The install is very simple (in fact there is no install program as such) all we need to do is extract the files into the required directory, as follows:

Notes:

Then click on the desktop icon to get the following:

When we accept this we get the following 'welcome' project:

Setting up project

We start by creating a new project under New->Project

This takes us through a set of wizard pages, first we want to setup as a wizard:

On the next screen enter the project name, then set the JDK compliance, I did this by clicking on 'Configure default':

Clicking on 'Configure default' gives the following screen, I set the compliance level to 5.0

Clicking on 'Installed JREs' gives the following screen, but I did not need to change anything on this page:

Clicking on OK takes us back to the wizard:

Clicking on next gives up a page which allows us to set 'Source', 'Projects', 'Libraries' and 'Order and Export' parameters. For now I have left these at the default and set them later when the files are loaded.

Click on 'Finish' then close the 'welcome' project, we can then see the project just setup:

I then copied the mjbWorld files into the workspace as shown here:

The mjbWorld files are availible from sourceforge here.

I then right-clicked on 'mjbworld' in Package Explorer and clicked on refresh:

The program files are then shown in the Package Explorer window but when using the 64bit version of Eclipse my system usually crashes with the following error (full report),

I have therefore used the 32 bit version of eclipse for the following. I also found that the Eclipse 3.1 seems more stable when run under java 1.4 so I start Eclipse using the following command line:

/usr/share/eclipse/eclipse -vm /usr/lib/jvm/java-1.4.2-sun-1.4.2.08/jre/bin/java

This seems reasonably relible.


We now need to tell eclipse about the JOGL library. In the menu under the Project -> Properties we can select 'Java Build Path' in the tree window and select the 'Libraries' tab. We can then click on 'Add JARs':

select jogl.jar

Click on 'Native library location'

click on workspace

click on the location where jogl.dll is located, in this case resources.

We can also set the Default output folder so that the main directory does not get cluttered.

If prompted we can click on 'yes' to move the existing outut:

Running the mjbWorld application

We can click on the down arrow to the right of the green arrow. Then select Run As->Java Application

In this case select 'mjbWorld' and then click on 'OK'. The program should then start.


metadata block
see also:

 

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover The Java Developer's Guide to Eclipse.

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

cover us uk de SuSE Linux 10.3. Operating system with a wide range of applications including Open Office. A good distribution for developers as it contains KDevelop. Java, Mono, etc. Can install itself as a dual-boot system with an existing Windows OS if required. For information about installing it see this page.

Can this page be improved?

Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page.

 

progam

I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here:

for xml encoding: http://sourceforge.net/projects/xes/

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2008 Martin John Baker - All rights reserved - privacy policy.