🚀 Your First Java Project in IntelliJ IDEA: Creating a “Hello World” in Java 🚀

-your-first-java-project-in-intellij-idea:-creating-a-“hello-world”-in-java-

Ready to create your first Java program using IntelliJ IDEA? In this article, I’ll guide you through the amazing journey of setting up a new Java project and running your very first “Hello World” program. Let’s keep it simple and practical! 💻🔥

Step 1: Creating the Project

  1. On the welcome screen, click “New Project”.
  2. Under New Project, select Java.
  3. Under Name, enter Hello World or the name of your project.
  4. Give your project a name, and for the “Location” field, you can leave the default path: ~/IdeaProjects.
  5. If you’d like, you can create a GitHub repository to version your code by checking the box labeled “Create a GitHub repository“.
  6. In Build System, choose IntelliJ.
  7. In the JDK field, select version 17 (or the version of your JDK).
  8. Uncheck the “Add sample code” box to start the project from scratch.
  9. Click “Create”.

ongratulations! You’ve successfully created a new Java project. 🎉

Image description

Step 2: Creating Your First Java Class

  1. Right-click the “src” folder, select “New”, and then “Java Class”.
    Image description

  2. A modal will appear where you can name your file, here “MyFirstClass“. Choose a name for the Class.
    Image description

  3. The basic structure of the class will be generated automatically.
    Image description

Step 3: Writing the Code

Inside your new class, type “main” and hit Enter. IntelliJ IDEA will automatically create the main method signature for you.
Image description
press enter

Image description
IntelliJ IDEA will automatically create the main method signature for you.

Within the main method, add the following code:

System.out.println("Hello World");

Image description

Step 4: Running the Program

Now, just click the green play icon to run your program. 🎉
Image description

Image description

That’s it! Your first Java program is up and running, and you can start exploring the power of IntelliJ IDEA for Java development on Ubuntu. 🚀

Ready to continue your Java programming journey? This is just the first step. Soon, we’ll dive into more features of IntelliJ IDEA and take your development skills further! See you next time! 👋

Total
0
Shares
Leave a Reply

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

Previous Post
k9s-–-manage-your-kubernetes-cluster-like-a-pro!

k9s – manage your Kubernetes cluster like a pro!

Next Post
beginner’s-guide-to-php-form-handling-with-cookies

Beginner’s Guide to PHP Form Handling with Cookies

Related Posts