Skip to content

Beginner · Getting started with Java · topic 1 of 60 · 20 min

What Java is and where it is used

Explanation

Java is a general-purpose, object-oriented programming language. Your code is compiled into bytecode, which runs on the Java Virtual Machine (JVM) on any operating system. It powers bank systems, large web backends, Android apps (alongside Kotlin) and big-data tools, which is why it remains one of the most hired-for languages in India.

A language built to run anywhere

Java was released by Sun Microsystems in 1995 (Oracle owns it today). Its big idea was "write once, run anywhere". Most compiled languages, like C, turn your code into machine instructions for ONE kind of processor and operating system. Java instead compiles your code into bytecode: compact instructions for an imaginary computer, the Java Virtual Machine (JVM). Every operating system has a JVM, so the same bytecode runs on Windows, Linux and macOS.

output
Hello.java  --(javac compiler)-->  Hello.class (bytecode)  --(JVM)-->  runs on Windows / Linux / macOS
The two steps: compile once, run on any JVM.

JDK, JRE and JVM

NameWhat it isWho needs it
JVM (Java Virtual Machine)The engine that loads and runs bytecodeEverything that runs Java
JRE (Java Runtime Environment)JVM + the standard class libraryOnly to run Java programs (older term)
JDK (Java Development Kit)JRE + tools: javac (compiler), java (launcher), jshell, jar, javadocDevelopers: install this

The JVM does more than interpret bytecode. Its JIT (just-in-time) compiler watches which code runs often and compiles those parts into fast native machine code while the program runs. That is why long-running Java servers are very fast.

Where Java is used

  • Banking and finance: core banking, payment switches and trading systems at many Indian and global banks run on Java.
  • Large web backends and microservices, usually with the Spring Boot framework, at e-commerce, travel and fintech companies.
  • Android: Android apps were traditionally written in Java; Google now recommends Kotlin first, but huge amounts of Java Android code still exist, and Kotlin runs on the same platform.
  • Big data and streaming tools in the JVM world: Kafka, Hadoop, Spark (Scala/Java), Elasticsearch.
  • Enterprise software, government portals, insurance and telecom billing systems.

Java is not JavaScript

Despite the similar names, Java and JavaScript are different languages with different designs. The name JavaScript was chosen in 1995 partly for marketing. Java is statically typed (types are checked when compiling) and compiled to bytecode; JavaScript is dynamically typed and runs in browsers and Node.js. If you know JavaScript, curly braces and if/for will look familiar, but the type system and object model are different.

Java versions

A new Java version is released every six months, and every two years one becomes an LTS (Long-Term Support) release that gets updates for many years. Recent LTS releases are Java 17 (2021), Java 21 (2023) and Java 25 (2025). Companies upgrade slowly, so you will meet Java 8, 11 and 17 at work too. This course uses features available in Java 21 and later, and says when something is newer.

Careful: Do not learn from very old tutorials that use Java 1.4–6 style everywhere (raw collections without generics, Vector, Date). Prefer resources that show modern Java: generics, the java.time package, records, switch expressions and var.
Think of it like this: The JVM is like a universal power adapter. Your appliance (bytecode) has one plug; the adapter makes it work in any country's socket (operating system). You do not rebuild the appliance for every country.
Tip: jshell, included with the JDK since Java 9, lets you type Java lines and see results instantly, like a calculator. It is great for trying small ideas from this course.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

What Java is and where it is used · 1/6

What is Java?

Welcome to Java Programming. First, let us see what Java is and why so many companies use it.

Prefer a video by a teacher? Find free videos on “what is java jvm jdk jre explained for beginners” on YouTube ↗

In real life: One build, many servers

A payments company in Pune builds its transaction service once as a .jar file of bytecode. The same file runs on developers' Windows laptops, the Linux test servers and the production Linux machines in the cloud. Nobody recompiles for each machine; each just needs a JVM.

bash
javac -d out src/com/pay/TransactionService.java
jar --create --file service.jar -C out .
java -cp service.jar com.pay.TransactionService
Compile, package into a jar, run anywhere with a JVM.

Practice (0/3 done)

Task 1 · Question

What does the javac command produce from Hello.java?

Task 2 · Question

Which do you install to WRITE and compile Java programs?

Task 3 · Practice

Find three job posts in India for Java developers (on any job portal). For each, note the Java version or framework mentioned (for example Java 17, Spring Boot, microservices) and the experience asked for.

Quick quiz

Question 1

1.What runs Java bytecode?

Question 2

2.What does the JIT compiler do?

Question 3

3.Which of these is an LTS Java release?

Question 4

4.Java and JavaScript are…

Read more (free)

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

What runs Java bytecode?

Answer: The Java Virtual Machine (JVM)

Bytecode runs on the JVM.

What does the JIT compiler do?

Answer: Compiles frequently used bytecode to native machine code at run time

JIT makes long-running Java programs fast.

Which of these is an LTS Java release?

Answer: Java 21

17, 21 and 25 are LTS releases; versions in between are short-term.

Java and JavaScript are…

Answer: Different languages with different type systems

They share some syntax style but are separate languages.

Can Kotlin and Java code be used in the same Android project?Related

Answer: Yes, they interoperate

Kotlin was designed to work alongside Java.

From Kotlin and Android: the big picture

System.out.println("Sum: " + 2 + 3) prints…Related

Answer: Sum: 23

Left to right: "Sum: " + 2 is a String, then + 3 joins "3".

From Installing the JDK and your first program

In which Java version did virtual threads become a final (non-preview) feature?Related

Answer: Java 21

JEP 444, Java 21.

From Virtual threads (Java 21)

System.out.println(10 / 4 + " " + 10 / 4.0) prints…Related

Answer: 2 2.5

Integer division then double division.

From Java interview questions

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. 4 more topics in “Getting started with Java” before its exam: Installing the JDK and your first program, Variables and primitive types, Operators and expressions, Type conversion and reading input.
  2. Module 1 exam: Getting started with Java · 12 questions · 20 min, without help. 5 topics of this module still to finish first.
  3. Then the next module, Control flow and methods. 60 topics left in the course before the final exam.