Encodera

Thanks for reading!

Donate to the site — we work hard for you.

Contents

Introduction to Java

Java is one of the most widely used programming languages. It powers bank and online store servers, Android apps and big data systems. The language is strict and a little verbose, but in return mistakes are caught early and code stays readable for years.

How Java works

A Java program is first compiled — translated from text into bytecode that the Java Virtual Machine (JVM) understands. There is a JVM for Windows, macOS and Linux, so the same bytecode runs on any of these systems without changes.

The compiler checks the program before it runs: if you mix up a type or misspell a name, it reports the error and points to the line.

Where Java is used

  • Servers and web services — banks, marketplaces, ticket booking. Most often together with the Spring framework.
  • Android — Java was the main language for mobile apps for a long time.
  • Big data — Apache Kafka, Hadoop and Elasticsearch are written in Java.
  • Desktop software and games — for example, the IntelliJ IDEA IDE and the original Minecraft.

Java 25 LTS

A new Java version comes out every six months, and every two years one of them gets LTS (Long-Term Support) status — it is maintained and patched for many years. This course is written for Java 25 LTS, released in September 2025. It introduced a short way to write a program without extra ceremony, and every example in the course uses it.

Installing the JDK

To write and run programs you need the JDK (Java Development Kit) — a bundle of the compiler, the JVM and the standard library. Download JDK 25 for your system, for example the Eclipse Temurin build from adoptium.net, and install it. Check the installation in a terminal:

java -version

Output (your build number may differ):

openjdk version "25.0.4.1" 2026-08-18 LTS
OpenJDK Runtime Environment Temurin-25.0.4.1+1 (build 25.0.4.1+1-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.4.1+1 (build 25.0.4.1+1-LTS, mixed mode, sharing)

Your first program

Create a file named Main.java with this text:

void main() {
    IO.println("Hello, world!");
}

Run it from the folder that contains the file:

java Main.java

Output:

Hello, world!

The java Main.java command compiles the file in memory and runs it right away. IO.println() prints the value in parentheses and moves to a new line. We will look at how this program is built in the next lesson.

Common mistake

Java is case-sensitive: IO and io are different names. If you write io.println, the compiler cannot find that name and the program does not start:

void main() {
    io.println("Hello, world!");
}

Output:

Main.java:2: error: cannot find symbol
    io.println("Hello, world!");
    ^
  symbol:   variable io
  location: class Main
1 error
error: compilation failed

"cannot find symbol" means an unknown name. The compiler shows the file and line number (Main.java:2) — start looking for the mistake there.

Thanks for reading!

Donate to the site — we work hard for you.