If you ever tried convincing Eclipse to use the class-specified directory structure, you know
it can be frustrating. This short tutorial shows you how to acheive this slightly elusive goal.
Create a new project.
Select 'Java' and then 'Java Project'.
|
|
Give the project a name.
Then, choose a directory for the the development process. In this example I am
using a non-default directory - C:\Harvard\assignments\example
|
|
|
In the next screen, click on the 'Add Folder' button.
|
|
|
In the next screen, click on the 'Create New Folder' button.
|
|
Name the new folder src.
|
|
Select the src folder and create a new one called Java.
|
|
|
Click OK and then click Yes on the following screen.
|
|
Set the default output folder:
In the build properties screen - to which you will return - click Browse near the text box specifying the output folder.
Create a new folder called classes.
Then click ok twice and you will return to the main editor screen.
|

|
Create the source package:
Right-click the name of the project and select 'New', and then 'Package'
|
|
Give the package the class-specified name:
harvard.cscie162.*your name*
|
|
Create a class in the package:
Right-click the bottom folder (the one with your name) inside the src directory
and select 'New', and then 'Class'
|
|
|
Give the class a name
|
|
Click Finish.
The new class will exist in the specified directory structure.
|
|