Compiling from the Command Line
- Save the code for your class in a file named Classname.java.
- Open a terminal window and cd in the ditrectory where your code is saved.
- To compile, type javac Classname.java.
- Fix any errors and go back to step 3.
- To run, type java Classname.
Getting Started with Eclipse
- Launch Eclipse and indicate the location of your workspace.
- Create a new project by selecting File->New->Project.
- Select Java Project and click next.
- Type the name of your project and click Finish.
- Create new class by selecting File->New->Class.
- Type the name of the class and click Finish.
- Type your code.
- To run, select Run->Run As->Java Application.
- If the console does not appear at the bottom of the screen, select Window->Show View->Console.
Sami Rollins