Eclipse Startup instructions CS106 Michael Eckmann Skidmore College revised: 09/14/2015 For the Linux lab machines. 1. After logging in, there should be an icon for MCS Applications. Double click that. Inside the window, there should be an icon for Eclipse, double click it. Alternatively you could open up a terminal window (by single clicking the Terminal window icon) and enter: eclipse & and press the enter key 2. When the Workspace dialog bog appears, keep the default directory to store your work. Then click ok 3. If you see a Welcome screen, click the X to the right of the word Welcome in the tab. Choose File -> Close All if necessary to start cleanly. 4. File -> New -> Java Project 5. Enter a name for the project (e.g. Lab01) --- I recommend no spaces click Finish 6. If you get a Confirm Perspective Switch Dialog click Yes 7. Either a) Left click on the package name in the "Package Explorer" (left panel) and do File -> New -> Class or b) Right Click on the package name in the "Package Explorer" (left panel) and select New -> Class 8. Source folder should be the package/project name For name enter a name like: HelloWorld (no spaces allowed) leave only public chosen and check public static void ... uncheck others click Finish 9. Now you should see a place to enter your Java code. Eclipse started the file for you. Enter code in the main method --- that is, between the two curly braces that appear after/below the main method declaration: public static void main(String[] args) 10. After you enter your code, do the following to Save, Compile and Execute your program. To save your source code: File -> Save (or just do Ctrl-S) Go to Project menu ****** If Build Automatically is checked then click it to uncheck it. ****** To build/compile your source code: Project -> Build Project To execute/run your program: Run -> Run As -> Java Application Click on the tab labeled "console" on the bottom to see the output of the program. 11. When you are finished using Eclipse, do: File -> Close All Right click on Project name in Package Explorer (left panel) and choose Close Project. 12. Your java program will be stored in a folder within the folder you specified (or left as default) at the Workspace dialog bog. Inside a project folder will be src and bin folders. The source code (the .java file(s)) will be in the src folder and the compiled code (the .class file(s).) will be in the bin folder. Often, you will need to send the .java files to your instructor via email.