So you want to create a Java project in Eclipse? Cool. Follow the steps below and get to coding!
Starting a New Java Project in Eclipse:
- Open Eclipse and select File –> New –> New Java Project. Give it a name in the resulting pop-up, then click “Next” and then “Finish.” That will create the JRE System Library.
- In the left-nav menu, right-click the new source folder (“src”) and select “New” and then “Class.”
- Give your new class a name, and under “which method stubs would you like to create?” select “public static void main” and click “Finish.” (If you forget to select public static void main, you can add it after. Once the new class is created, you can type “main” after the first “{” symbol, then control-space and the enter key to create the main method.)
- Delete the auto-generated “TO DO” stub in the main method, and add your own code.
- To save: File –> Save (or Save As)
- To run your code, click the green play button in the top nav and select “Run as —> Java Application.” After the first time, you can simply click the green play button once and it will automatically run that way.