Eclipse Tutorial

Other Topics

Managing files and projects

Deleting a class

Now that you know how to create a project and a Java class, you might also want to know how to delete them. To remove a class file from a project, right click on it in the Package Explorer and select “Delete.” A dialog box asking you to confirm will appear. Selecting “Yes” will delete the Java file.

Deleting a project

To delete a project, right-click on the project in the Package Explorer. Again, select “Delete” from the context menu. To delete your project select the option “Also delete contents under…” and select “Yes.”

Exporting (Projects)

Before exporting a project, make sure you close any other projects you don't want to export. This will make things a little bit simpler. You can export a copy of your project as a zip file as follows:

Importing (Projects)

Renaming Java classes and files

To change the name of a project, class, file, variable or method: highlight the item, right-click, and select Refractor → Rename. You will then be prompted to enter a new name.

If you are editing a Java file and you want to locate a specific phrase somewhere in your code, you can use Eclipse’s search tool. Eclipse has a more advanced searching mechanism than most Windows applications. Select Search → Search. This will bring up the Search window, which has a series of tabs. These searching utilities make it easy to quickly locate anything in your project, so experiment with the search tool—it can save you a lot of time later.

Things to keep in mind

Editing errors/warnings options

Here are some suggested settings for errors/warnings in Eclipse. You will find this section in Eclipse by accessing Window → Preferences → Java → Compiler → Errors/Warnings.

Adding 80-Characters Mark

See Adding 80-Characters Mark

Code Coverage for Eclipse

EclEmma is a free Java code coverage tool for Eclipse. For additional information visit EclEmma. Notice that recent Eclipse versions already have a code coverage feature. To obtain code coverage information in Eclipse select: Run→Coverage As→Java Application