This repository contains a simple Java program that prints "Hello World" to the console. It demonstrates a basic setup for running Java code locally using Java SE 17.
java-explorer
├── HelloWorld.java # Java source file
└── HelloWorld.class # Compiled Java bytecode file
- Java SE 17: Make sure Java SE 17 is installed on your system. You can check your version by running:
java -version
-
Compile the Java file: In PowerShell or your preferred command line, navigate to the directory containing
HelloWorld.java
, then run:javac HelloWorld.java
This will generate a
HelloWorld.class
file. -
Run the compiled program: Execute the program with:
java HelloWorld
You should see the following output:
Hello World
PowerShell 7.4.6:
PS C:\Home\DEV\Java-SE-17\java-explorer> javac HelloWorld.java
PS C:\Home\DEV\Java-SE-17\java-explorer> java HelloWorld
Hello World
PS C:\Home\DEV\Java-SE-17\java-explorer>
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
This project is licensed under the MIT License.