Java Hello World + IDE
Small guide to setup your IDE to develop Java programs and clone Git repos.
Install Java + IDE
This is based on the official guide https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html#get-started
- Download and Install Intellij IDEA Community Edition.
https://www.jetbrains.com/es-es/idea/download
2. Open Intellij and create a new project.
3. If this is your first time with Java, you will see the <No SDK> message in the JDK field.
4. Click the JDK dropdown and select download JDK.
5. Choose a stable version as 17. Optionally you can change this version later (see step 12).
6. Click download and wait.
7. You will see the JDK 17 selected. Click create.
8. The project will open with a Hello World example by default.
9. Wait for the indexing to complete.
10. Open src/Main file.
11. Click the play button at the left side of the main method. Then select Run ‘Main.main()’.
12. At the bottom you will see the Hello world! message printed in the console. Once you have the project opened you can change the JDK version from the menu File > Project Structure > language level.
Clone Git repos
We will use the Intellij IDE to install Git and clone git repos.
- Go to File > New > Project from Version Control.
2. If you don’t have Git installed click Download and Install. For windows users it will install an extra app, you must accept it.
3. After Git is installed, paste the Git URL and click Clone.
4. It will ask you to trust the project and to open it on a separate window.
5. Finally you will see the project opened.
Conclusion
Setting up an environment to clone and run Java code is super easy using Intellij.