Download Guide to the Eclipse IDE

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Guide to the Eclipse IDE.
By Dan Hollingsworth, October 2005
A. Creating a project for Java.
1. Download from eclipse.org.
2. Decompress and load the executable (no installer provided).
3. Close the welcome tab.
4. For small screens, move the tabs at the bottom to the right by
dragging them.
5. File > New > Project : Java Project
6. Right click project.
New > Source Folder : "src"
7. Right click source folder.
New > Package : "nameItAnything"
Note: Using packages is generally a good thing and keeps things
organized.
8. Right click package. New > Class
9. The class is where you put your code. For Javadocs, enter
"/**" and hit return just above whatever you wish to document
(method/class/field).
B. Compiling/Building
1. Window > Preferences : type "jre"
2. In "Installed JREs" choose whatever folder Sun provided for the
JDK. Don't select child folders such as the bin.
3. Hit the red play button in the toolbar. Choose "Java
Application" then point it to your main class. Run.
4. To debug, enter a break point in the code by double clicking
the grey area in the left margin. Hit the bug next to the play
button.
5. Hit the red power button on the console tab to end the
application if you have not yet set the JFrame's
defaultCloseAction(JFrame.DISPOSE_ON_CLOSE)
C. Getting Sun's Javadocs
1. Download the sourcecode to Java from
http://java.sun.com/j2se/1.5.0/download.jsp about halfway down the
page: "Download JDK 5.0 Source via..."
2. In your project's JRE System Library, right click rt.jar,
Properties : Java Source Attachment : External File/External
Folder. Find the source folder or archive and select it.
3. Mouse over anything built into Java and you will have its
javadoc. On auto-complete (ctrl-space) you will also have them.
D. Tips/Tricks
1. Put the mouse over a method or member instance and hold control
then click. You will be taken to where it was created.
2. Look for the lightbulbs in the left side grey margin, they will
often correct your code and write try/catches and add
unimplemented methods from inherited classes.
3. Take advantage of the source and refactor menus (which have
rename, format, and organize imports).
4. Set up your own code formatter by typing "formatter" into the
preferences window.
5. Right click a file and choose Compare To > Local History
6. Perhaps use the built-in CVS frontend if you're using CVS.
Eclipse's interface should be sufficient for this project.
Good luck,
Dan
[email protected]