< Zurück | Inhalt | Weiter >

10.4.2 Using Eclipse for a New Project

Now that you have Eclipse up and running (Figure 10.13), you will want to create a Java project. Eclipse has “wizards” (to use the Microsoft Windows terminology) for creating projects. From the main menu, select File > New > Project. You will get the screen shown in Figure 10.14.

Now, you are not an idiot. This is not “Java Applications Programming on Linux for People with Well Below Average Intelligence.” We’re not going to walk you slowly and painfully through a screenshot of every window Eclipse


Figure 10.13 The Eclipse Resource perspective

can display and pretend that this is “educational.” We like trees too much to do that. So let’s pick up the pace a bit. The first screen in Figure 10.14 asks you to select the type of project. The next screen asks for a project name and it automatically chooses a directory to house the project. In Section 10.4.3 we will talk about changing away from this default. For now, trust Eclipse to do it right. Enter a project name and hit the Next button.

The next screen shows a tabbed display. The first tab allows you to add folders for source code. If you have already worked out a directory structure for your project, you may build it here. The next tab is the Projects tab. Here you specify other projects on which this project depends. The next tab is the Libraries tab. Basically, it lets you specify the project’s classpath. Eclipse puts its preferred set of JARs on the classpath by default, including those that are standard with whichever Java runtime Eclipse found on startup. The last tab is called Order and Export; it allows you to specify the order in which source


Figure 10.14 Step one: New project

folders should be built, as well as to specify which folders are accessible to other projects that name this project on their Projects tabs (in other words, this is the “other side” of the Projects tab).

That’s the final wizard box. Hit the Finish button. A dialog box pops up to tell you that the project you just created is associated with the Java perspec- tive. Since you are currently in the Resource perspective, it asks you if it may switch you to the Java perspective. Hit the Yes button, and you will be rewarded with the Java perspective display (Figure 10.15).

At this point, your exploration of the Eclipse tools would be more fruitful than anything we could tell you. There is a marvelous book on Eclipse, The Java Developer’s Guide to Eclipse by Sherry Shavor et al. from Addison-Wesley. We encourage you to seek out that book.