It’s been quite a while since I last touched Java in any meaningful way, and I’ve decided to revisit it, this time through a series of blog posts. The goal is simple: document my journey as I explore the modern Java ecosystem. Writing things down helps me absorb them better, and hopefully, others may find value in this process too.

Step 1: Installing OpenJDK

Java has undergone a few licensing changes, especially around Oracle’s JDK distribution. Without diving too deep into the legal side of things, I decided to go with the OpenJDK, which is a solid, free, and community-supported alternative.
You can grab OpenJDK from:
👉 [https://jdk.java.net]
or install it using a package manager like sdkman (Linux/macOS) or choco (Windows).

Step 2: Setting Up VS Code for Java

A) Next up, the editor. I’m using Visual Studio Code because it’s lightweight, extensible, and works well for quick Java prototyping.

B) Download VS Code: [https://code.visualstudio.com]

Install the following Java-related extensions (open the Extensions tab with Ctrl + Shift + X):

✅ Language Support for Java™

🐞 Debugger for Java

✅ Java Test Runner

☕ Maven for Java

🔍 Java Dependency Viewer

📦 Java Extension Pack

💡 Tip: You can just install the Java Extension Pack, and it’ll pull in all the essential tools in one go.

C) Lastly, make sure Maven is installed via your CLI. This will come in handy when we start working with full-fledged projects.

Step 3: Writing Hello World in Java

For this first post, I’m keeping it simple just a single Java file. Here's the classic "Hello, World!" with a small twist:

public class HelloWorld {
  public static void main(String[] args) {
    var helloWorld = "Hello world from Java!";
    System.out.print(helloWorld);
  }
}

Save it as HelloWorld.java, then press Ctrl + F5 in VS Code to run it.

Output:

Hello world from Java!

🎉 Success!

Troubleshooting

I did run into a couple of hiccups:

  1. One error was related to a missing classpath (likely because I was running a raw .java file without a formal project structure).

  2. Another issue involved VS Code not generating a launch.json file automatically.

Both were resolved after a quick restart of VS Code. So if you run into similar issues, a restart might do the trick.

What’s Next?

In the next post, I plan to dive deeper into Java’s project structure exploring what all the "boilerplate" means, how Maven fits in, and how to scaffold a Java project from the ground up properly.

This is just the beginning thanks for joining me on this Java rediscovery journey!