Beginner · Getting started with Java · topic 1 of 60 · 20 min
What Java is and where it is used
Explanation
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.
Hello.java --(javac compiler)--> Hello.class (bytecode) --(JVM)--> runs on Windows / Linux / macOSJDK, JRE and JVM
| Name | What it is | Who needs it |
|---|---|---|
| JVM (Java Virtual Machine) | The engine that loads and runs bytecode | Everything that runs Java |
| JRE (Java Runtime Environment) | JVM + the standard class library | Only to run Java programs (older term) |
| JDK (Java Development Kit) | JRE + tools: javac (compiler), java (launcher), jshell, jar, javadoc | Developers: 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.
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
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.
javac -d out src/com/pay/TransactionService.java
jar --create --file service.jar -C out .
java -cp service.jar com.pay.TransactionServicePractice (0/3 done)
What does the javac command produce from Hello.java?
Which do you install to WRITE and compile Java programs?
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
Read more (free)
Related help
Related topics
- Installing the JDK and your first programGetting started with Java · same module
- Variables and primitive typesGetting started with Java · same module
- Operators and expressionsGetting started with Java · same module
- Kotlin and Android: the big pictureKotlin and Android App Development · Kotlin basics
- Virtual threads (Java 21)Multithreading and concurrency
- Java interview questionsDesign patterns, JVM internals and interviews
Questions people ask about this
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.
System.out.println("Sum: " + 2 + 3) prints…Related
Answer: Sum: 23
Left to right: "Sum: " + 2 is a String, then + 3 joins "3".
In which Java version did virtual threads become a final (non-preview) feature?Related
System.out.println(10 / 4 + " " + 10 / 4.0) prints…Related
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
- 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.
- Module 1 exam: Getting started with Java · 12 questions · 20 min, without help. 5 topics of this module still to finish first.
- Then the next module, Control flow and methods. 60 topics left in the course before the final exam.