CodingBowl

Java Mini Lesson 1: Writing and Running Your First Program in VS Code

Published on 18 Apr 2026 Edu Mini Courses
image
Photo by Kelly Sikkema on Unsplash

Starting your journey in IT Applications Development doesn’t have to be scary. To get started, you need three main tools: Visual Studio Code (VS Code), the Extension Pack for Java, and the Java Development Kit (JDK).

Step 1: Install the "Brain" (Extension Pack for Java)

In VS Code, go to the Extensions view (Ctrl+Shift+X) and search for the Extension Pack for Java. This pack gives you syntax highlighting, which colors your code to make it readable, and adds "Run" buttons so you can test your code easily.

Step 2: Install the "Engine" (JDK)

Without the JDK, your computer won't understand the Java language. You can install it through VS Code by pressing Ctrl + Shift + P and typing "Java: Install New JDK". Once installed, remember to restart VS Code to activate it!

The Basics of a Java Program

Every Java program follows a few simple rules:

  • Classes: All your code lives inside a "class".
  • The Main Method: This is the starting point where your code begins to run.
  • Printing: We use System.out.println() to show text on the screen.
  • Semicolons: These are like "periods" at the end of a sentence; every statement needs one.

Your First Code


public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}

To run this, click the play button provided by the Extension Pack, or type javac HelloWorld.java followed by java HelloWorld in your terminal.

Meow! AI Assistance Note

This post was created with the assistance of Gemini AI and ChatGPT.
It is shared for informational purposes only and is not intended to mislead, cause harm, or misrepresent facts. While efforts have been made to ensure accuracy, readers are encouraged to verify information independently. Portions of the content may not be entirely original.

image
Photo by Yibo Wei on Unsplash