http://www.eclipse.org/downloads/eclipse-packages
You will see the download page like this:
You can install Eclipse either by downloading the Eclipse Installer or package (zip file). I’d recommend you to download by package. Eclipse comes with various packages for different development purposes. For Java, there are two main packages listed as you see above:
Eclipse Neon requires Java 8 or newer so make sure you have JDK 8 already installed on your computer. If not, follow this tutorial to install JDK.Click eclipse.exe file (Windows) to start the IDE. You will see the splash screen of Eclipse Neo:
That’s it! You have successfully installed Eclipse IDE. Next, let’s see how to create a workspace.
By default, Eclipse created a workspace directory at your USER_HOME\workspace. If you want to choose another directory, click Browse. Here I chose a different workspace:
Check Use this as the default and do not ask again if you don’t want to be asked whenever you start Eclipse. You can always change workspace when Eclipse is running.Click OK. You should see the welcome screen:
Now, we are ready to create a Java project.
Here we choose Java perspective. Click OK. Here’s how the Java perspective would look like:
Enter project name: HelloWorld. Leave the rest as it is, and click Finish.You should see the HelloWorld project is created in the Package Explorer view as following:
It’s recommended to create a package for your project. Right click on the project, and select New > Package from the context menu:
In the New Java Package dialog, enter the name your package. Here I enter net.codejava:
Click Finish. You should see the newly created package appears:
Now, it’s time to create a Java class for your hello world application.
The New Java Class dialog appears, type the name of class as HelloWorld and choose the option to generate the main() method:
And click Finish. The HelloWorld class is generated like this:
Now, type some code in the main() method to print the message “Hello World” to the console:
That’s it. We have created a Java hello world program using Eclipse IDE.
If you want to disable automatically build feature, click the menu Project and uncheck Build Automatically:
However, it’s strongly recommended to keep the auto build mode for it helps you detect errors instantly.Now, let’s run the hello world application. Click menu Run > Run (or press Ctrl + F11), Eclipse will execute the application and show the output in the Console view:
That’s it! The HelloWorld program has run and printed the output “Hello World” and terminates.We hope this tutorial help you get started with Eclipse and Java easily. Thank you for reading.What's next? I recommend you to continue with this article: Java OOP: Understand Classes and Objects Watch this tutorial in video:
Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.