First Java Project in IntelliJ IDEA Community Edition: Hello World

If you’re new to Java development and wondering where to start, you’re in the right place! In this beginner-friendly guide, we’ll walk step by step through creating your first Java project in IntelliJ IDEA Community Edition (CE).

By the end of this tutorial, you’ll know how to:

  • Install IntelliJ IDEA CE on Windows
  • Create a new Java project
  • Write and run your first Java Hello World IntelliJ program
  • Explore IntelliJ’s built-in terminal and build tools (Maven/Gradle)
  • Troubleshoot common beginner issues
First Java Project in IntelliJ IDEA Community Edition- Hello World

This post is designed to be encouraging and easy to follow, even if you’ve never written a single line of Java code before.

Step 1: Install IntelliJ IDEA Community Edition

First things first, you need to download and install IntelliJ IDEA on your computer.

IntelliJ Idea download page

Follow my detailed step-by-step guide here: How to Download and Install IntelliJ IDEA Community Edition on Windows

Step 2: Create a New Java Project

  1. Open IntelliJ IDEA Community Edition.
  2. On the Welcome Screen, click New Project.
  3. In the left-hand panel, select Java.
    • If IntelliJ prompts you to set up a JDK (Java Development Kit):
      • Click Download JDK and select the latest stable version (e.g., Java 17+). IntelliJ will handle the download and setup for you.
  4. Name your project, for example: MyFirstJavaProject.
  5. Choose a location where you want to save your project.
  6. Click Finish.
IntelliJ Idea IDE Installed welcome page
create project in intellij idea hello world

Step 3: Write Your First Java Project in IntelliJ IDEA (Hello World)

Now that your project is ready, let’s write some code.

  1. In the Project Explorer (left sidebar), right-click the src folder → select New → Java Class.
  2. Name the class: HelloWorld.
  3. Replace the default code with this:
Java
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
  1. To run your program:
    • Right-click inside the code editor and select Run ‘HelloWorld.main()’.
    • Or, click the green play button at the top.
Write Your First Java Program and run it

If everything is set up correctly, you should see the output:

Hello, World!

Step 4: Using the Terminal and Build Tools

IntelliJ IDEA CE comes with an integrated terminal and supports popular build tools like Maven and Gradle.

  • Using Terminal:
    • At the bottom of IntelliJ, click on the Terminal tab.
    • You can run commands like:

java -version

To check your installed Java version.

Using the Terminal and Build Tools
  • Using Maven or Gradle (optional for beginners):
    • When creating a project, IntelliJ gives you the option to use Maven or Gradle.
    • These tools help manage dependencies (external libraries) and automate builds.
    • If you didn’t enable them during project setup, don’t worry; you can add them later as your projects grow.

Step 5: Troubleshooting Common Issues

Here are some solutions to the most common issues:

  1. Problem: IntelliJ says “No JDK found”.
    • Fix: Download a JDK from IntelliJ’s setup wizard or install from Oracle.
  2. Problem: “Class not found” or the program won’t run.
    • Fix: Ensure your file is saved in the src folder and contains a valid main method.
  3. Problem: The Program compiles, but no output appears.
    • Fix: Double-check you’re running the correct file (HelloWorld.main()) and not an empty project.
  4. Problem: Terminal shows java not recognized.
    • Fix: Add Java to your system PATH or reinstall using IntelliJ’s JDK download option.

Tips for Beginners

  • Don’t overload your IntelliJ with plugins; start simple.
  • Use keyboard shortcuts like Shift + Shift (double-tap shift key) to search for anything.
  • Write small programs (like Hello World, calculator, loops) to get comfortable.
  • Always save your work (Ctrl + S) before running the code.

Conclusion

Congratulations! You’ve just created and run your very first Java Hello World IntelliJ project in IntelliJ IDEA Community Edition. From here, you can explore building larger applications, learning Maven/Gradle, and even connecting to databases: all within IntelliJ Community Edition.

This beginner-friendly IntelliJ IDEA Community Edition tutorial is just the start of your Java journey. The best way to learn is to keep experimenting. Write more small programs, break them, fix them, and grow your confidence step by step.

See Also: 10 IntelliJ IDEA Shortcuts Every Java Developer Should Know

Share with friends

Leave a Comment

Your email address will not be published. Required fields are marked *