Java Getting Started

</>Coding Tamilan.← Java course & curriculum
Java Masterclass · Lesson 02 / 50 · English

Java Getting Started

Set up once. Run your first program.

Step-by-step explanationsRunnable JavaPractice + answer

Read this topic in தமிழ் ↗.

By the end of this lesson, you can…

  • Explain the key idea behind Getting Started.
  • Read and run a complete example, then predict what changes.
  • Recognize the topic-specific mistake discussed below.
01 / The concept

Understand the idea

For local development, install a JDK, which includes the tools needed to compile and run Java. Confirm both java -version and javac -version in a fresh terminal. Save the example as Main.java, compile with javac Main.java, and run with java Main from the directory containing the compiled class. The browser editor below provides a separate environment; it does not install Java on your computer.

02 / Step by step

Explore the details

A local setup checklist

  1. Install a JDK from a trusted distribution.
  2. Open a fresh terminal and check java -version and javac -version.
  3. Choose an editor and create a file named Main.java.
  4. Compile with javac Main.java, then run with java Main.

Compiler and runtime versions must be compatible. If a command is not found, check the installation and PATH rather than repeatedly reinstalling unrelated editor extensions.

03 / Read and predict

A complete runnable example

This complete Main.java program focuses on the lesson idea. Reference fragments above may demonstrate individual statements; this example includes the imports, entry point, and supporting types it needs.

Main.java · complete runnable exampleJAVA
public class Main {
    public static void main(String[] args) throws Exception {
        System.out.println("My Java setup is working!");
    }
}
Predict first. Then reveal the expected output / வெளியீடு
My Java setup is working!

The output shown was checked by running this complete example. Trace the executed statements in order, then compare with your run.

04 / Learn by changing

Change it. Run it. Understand it.

Load this lesson example into the editor. Change one value or statement, predict the result, then press RUN to execute Java.

Open Java editor ↗
After the editor loads, choose Load this lesson example, then press RUN.

Powered by OneCompiler. Code you run is sent to OneCompiler for execution. For Scanner examples, supply input in the editor I/O panel; for file examples, files exist in its execution environment.

05 / Your turn

Make it your own

Practice challenge

Run the example in the browser, then reproduce it locally using the two commands above.

Reveal the answer and reasoning / விடை

Both runs should print the same message. If javac is not found locally, check that you installed a JDK and configured the terminal PATH.

One mistake to avoid: An online compiler working successfully does not prove your local JDK is configured. Check the local compiler separately.

Your learning checkpoint

  • Explain the example without reading the output first.
  • Make the change requested in the practice task.
  • Describe why the result changed—or why compilation failed.

Ready to move on? Follow the next lesson in course order, or return to the curriculum to review a prerequisite.

Coding Tamilan · Understand the idea. Try the code. Build the habit.