How to Use Eclipse in Your Java Applications

ssb
I. Introduction to Eclipse

Eclipse is a Java development environment, free, open-source and extensible. The Java development is a set of plugins. However, other Eclipse plugins can make use of any development tools, whatever the language (C ...) and file formats supported. Attention, however, Eclipse does not run JRE (Java Runtime Environment) or Java Development Kit, which is why you will have a Java virtual machine JRE installed prior to installation.

The purpose of this tutorial does not teach you the Java language but you learn how to use Eclipse to test your code in Java. Note that we will see how to create a java project, compile, run a Java program ... but this is quite feasible for other languages and the process differs a little. You must install a plug-in if you want to add other programming languages to Eclipse.

Here is the official site:

http://www.eclipse.org/

1 - Installing Eclipse

Once you've visited the official website, after downloading the software you get a zip file you just have to unpack it to the place you want.

You can create a shortcut "eclipse.exe" on your desktop, which will be much more convenient for you.

2 - Launch Eclipse

Run the EXE file.

This is your working directory, it is where all your projects will be saved. You can leave it at default or change it by clicking "Browse" is like you. Then click "OK".

3 - Create a Java project

We will now see how to create a Java project under Eclipse. To do this, first click on the File menu and select "New" and "Project".

Select "Java Project" and click "Next". (Note that if you want to code a Java applet you must pull down the menu "Java" lower then select "Java Applet").

Enter a name for your project, the one you want and click "Next" without touching the default options.

Click "Finish" and your Java project is created.

4 - Creating a Java application

Your project is located in the "Package Explorer" and must include JRE by default. To add a file right-click your mouse on your project (or go through the File menu) and then choose "New" and "File".

Here enter the name of your file with the extension .Java and then click "Finish". You have to code your Java application.

5 - Compilation and execution

First know that Eclipse compiles your program automatically when you save. To check if the default option is enabled click on the "Project" tab and check the option "Build Automatically" is checked.

If this is enabled then save your file after your application code. This is done by "Ctrl S" or through "File" then "Save".

Then run your program. To do this in the menu click "Run".

Double click on "Java Application". You have nothing else to except click on "Run" to complete the task.

This corresponds to my little program and operates smoothly. Note that if you have any errors in your compilation you need to solve before them before moving on.

Finally note that you will not need to always pass through "Run ..." to run your program. Just click on the execute button, it will relaunch the last program.

This is a very good IDE (Integrated Development Environment) to develop open source applications in many languages. In terms of features, I would say it has everything that one can dream. Auto compilation, auto-generation code, a debugger, etc. The only drawback is that it requires a fairly recent PC to run Eclipse well.

Published by ssb

View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.