Java
Java for Beginners: Core Concepts Explained
· Eric B.
Java is a general-purpose, object-oriented language that runs on a virtual machine, which means code compiled once runs on Windows, Linux, and macOS without change. This guide covers the language's origin, its core features, the platform editions, the JDK tools you use every day, and the IDEs that make development practical. It is the first post in the Java for Zombies series, building toward writing and running real programs.

Where Java Came From
Java was developed by James Gosling at Sun Microsystems in the early 1990s. The original project name was Oak, created to program small consumer-electronics devices where the problem was that each new device required rewriting the code. The goal: a language independent of the underlying hardware.
The project shifted direction in 1994 when the graphical browser Mosaic made the internet mainstream. Sun recognized that the same hardware-independence problem existed across the internet: a global network of machines with different operating systems and CPU architectures. The project pivoted from consumer electronics to the web.
In 1995, Oak was renamed Java after a type of coffee popular in the United States, and the official logo became a steaming cup. Java applets allowed programs to run inside any browser, regardless of operating system or processor. Major browsers added Java support quickly, and the language grew fast.
Oracle acquired Sun Microsystems in 2010 and has owned Java since. Version numbering changed over time: Java 2 covered versions 1.2, 1.3, and 1.4; after that, the "2" was dropped. Today the language follows a 6-month release cadence, and Java 21 (released 2023) is the current long-term support (LTS) release.
Core Language Features
Easy to Learn
Java removes several features from C++ that cause hard-to-debug bugs:
- No raw pointers
- No operator overloading
- No multiple inheritance
- No manual memory deallocation
- Automatic memory management via the garbage collector
The result is a language with syntax similar to C++ but fewer footguns. Most students coming from C find the transition straightforward.
Object-Oriented
Java is a class-based, object-oriented language. Every piece of application code lives inside a class. Java does accept primitive variable types (int, char, double, etc.) directly for performance, but even primitives have wrapper classes (Integer, Character, Double) when objects are needed.
Multi-Platform (Write Once, Run Anywhere)
This is the defining feature. A Java source file (.java) is compiled into bytecode (.class) rather than into machine code for a specific processor. The bytecode is then interpreted by the Java Virtual Machine (JVM), also called the JRE (Java Runtime Environment).
The JRE is distributed free for virtually every operating system. A .class file runs identically on any machine that has the JRE installed. The programmer compiles once; the bytecode runs everywhere.
Two mechanisms speed up execution that would otherwise be slow from interpretation:
- Native compilation: the Java program compiles directly to machine code for a target platform, gaining speed at the cost of portability.
- JIT (Just-In-Time) compilers: as bytecode is interpreted, the JIT compiles hot paths to native machine code and caches the result. Subsequent calls skip interpretation entirely.
Reliable Memory Handling
Java performs bounds-checking on arrays and disallows direct pointer arithmetic. Accessing an out-of-bounds index throws an exception instead of silently corrupting memory. Combined with automatic garbage collection, these features eliminate whole categories of bugs that consume hours in C and C++.
Safe by Design
Java includes a security model specifically designed for network code. Applets (historically) and sandboxed code cannot access file system resources or network sockets outside defined boundaries. These restrictions limit what malicious code can do even if it executes inside the JVM.
Multithreaded
Java supports multiple threads natively through java.lang.Thread and the java.util.concurrent package. Two threads can run simultaneously on a multicore processor, or interleave on a single core. The standard library includes synchronization primitives, executors, and concurrent data structures.
Dynamic Class Loading
Java loads classes on demand at runtime (dynamic binding). A class not referenced at startup is not loaded until first use. This matters for plugin architectures and for the historical applet model, where code was fetched from the network only when the page needed it.
What You Can Build with Java
Standalone console applications run from the command line, the same model as programs written in C or Python.
Graphical applications use the java.awt and javax.swing packages (built-in) or the newer JavaFX toolkit for richer UIs.
Servlets and web back-ends run inside an application server such as Apache Tomcat or GlassFish. Frameworks like Spring Boot and Jakarta EE build on this model to power most enterprise Java web services.
Android applications use Java (and Kotlin, which runs on the same JVM) as the primary language through the Android SDK.
MIDlets were Java applications for early feature phones and PDAs, now largely replaced by Android.
The Java Platform Editions
Three editions divide the standard library by deployment target:
Java SE (Standard Edition) covers common application development: the core language, the collections framework, I/O, networking, concurrency, and the GUI toolkits. This is what you install when you download the JDK.
Jakarta EE (formerly Java EE / J2EE) adds enterprise capabilities: Servlets, JSP, JPA (database persistence), JMS (messaging), and CDI (dependency injection). Spring Boot is the dominant framework built on top of these APIs.
Java ME (Micro Edition, formerly J2ME) targets constrained devices. Largely superseded by Android for mobile, but still used in some embedded systems.
The Java Platform: JVM and the API
The Java platform consists of two components:
- Java Virtual Machine (JVM): the runtime that executes bytecode
- Java API: the standard class library
The API is organized into packages. The most important ones:
| Package | Purpose |
| --------------- | ---------------------------------------------------------------- |
| java.lang | Core language types: String, Object, Thread, Math |
| java.io | Streams, readers, writers, file I/O |
| java.util | Collections, date/time, random, event model |
| java.math | Arbitrary-precision arithmetic |
| java.text | Formatting text, numbers, and dates for different locales |
| java.security | Encryption, key management, access control |
| java.net | TCP/UDP sockets, HTTP connections |
| java.sql | JDBC: connect Java programs to relational databases |
| java.applet | Legacy applet support (deprecated in Java 9, removed in Java 11) |
| java.awt | Original GUI toolkit (Abstract Window Toolkit) |
| javax.swing | Cross-platform GUI components built on top of AWT |
Setting Up the JDK
To write and compile Java, install the JDK (Java Development Kit). The JDK bundles the compiler, debugger, documentation generator, and the JRE.
Download the JDK from the Oracle download page or use OpenJDK (the open-source build available at adoptium.net).
After installing, configure three environment variables:
PATH: add the JDK bin/ directory so commands like javac and java are available from any terminal location.
JAVA_HOME: set to the JDK install folder. Most Java-based tools (Maven, Gradle, Spring Boot) read this variable.
CLASSPATH: tells Java where to look for .class files and .jar libraries. Modern build tools (Maven, Gradle) manage this automatically; you rarely set it manually.
Setting Environment Variables on Windows
Open System Properties (right-click This PC, then Properties), click Advanced system settings, then Environment Variables. Select the PATH variable, click Edit, and add the path to the JDK bin/ directory at the end. Add JAVA_HOME as a new system variable pointing to the JDK root.
Verify the install:
java -version
A working install prints the version string, for example java version "21.0.3".
JDK Command-Line Tools
The JDK ships with several tools used from the terminal:
javac: the Java compiler. Compiles .java source files to .class bytecode files.
javac Example.java
java: the interpreter. Runs a compiled class.
java Example
No file extension here: the argument is the class name, not the filename.
javadoc: generates HTML API documentation from source-code comments.
javadoc Example.java
appletviewer: (historical) ran applets from an HTML page without a browser. Removed in Java 11.
Java Version History
Java has had regular major releases since JDK 1.0 in 1996. Key milestones:
| Era | Versions | Notes | | --------------- | ---------- | ------------------------------------------------------ | | Classic | 1.0-1.1 | Original release, AWT, applets | | Java 2 | 1.2-1.4 | Collections framework, Swing, JDBC | | Tiger-Dolphin | 5.0-6 | Generics, enhanced for-loop, annotations | | OpenJDK era | 7-10 | Oracle opens source, lambda (Java 8), modules (Java 9) | | 6-month cadence | 11-present | LTS every 3 years; current LTS is Java 21 |
From version 1.6 onward, the "1.x" naming was dropped in marketing; Java 1.6 became Java SE 6, and so on. Developers now refer to versions by their major number: Java 11, Java 17, Java 21.
The official API documentation is at docs.oracle.com/en/java/.
IDEs for Java Development
The JDK command-line tools are enough to compile and run programs, but most developers use an IDE for code completion, debugging, and project organization.
IntelliJ IDEA (JetBrains) is the most widely used Java IDE. The Community edition is free and open-source and covers the full Java SE development workflow. The Ultimate edition adds Spring, Jakarta EE, and database support.
Eclipse is a free, open-source IDE that has been popular in enterprise Java development for two decades. It also supports C++ and other languages through plugins.
NetBeans is a free, open-source IDE that bundles a Tomcat or GlassFish server for testing server-side applications. It supports Java, PHP, HTML5, and C++.
Visual Studio Code with the Extension Pack for Java provides a lightweight alternative if you prefer a text editor with language-server-protocol features rather than a full IDE.
That covers the foundations: where Java came from, what makes it different from C and C++, the three platform editions, the API packages you will use constantly, the JDK setup, and the IDEs developers reach for. The next post in this series walks through your first Java program, compiling and running it from the command line.
If an assignment is giving you trouble, the developers at Java Assignment Help handle class design, data structures, Spring Boot projects, and algorithm problems, with a code walkthrough included so you can follow what was written and why. For other languages, Computer Science Homework Help covers algorithms, data structures, and CS fundamentals across the curriculum. Once you have the basics down, Exception Handling in Java is the next concept most courses assign.
Related articles
- Java
Java Swing Tutorial for Beginners
Learn Java Swing from scratch: build your first window, wire button events, master five layout managers, and assemble a working calculator GUI.
May 24, 2024
- Java
Advanced Java Data Management Techniques
Master advanced Java data management: optimize data structures, handle concurrent access, tune memory, and use serialization and compression in real applications.
May 3, 2024
- Java
Java File I/O: Read, Write, and Manage Files
A practical guide to Java file I/O: streams, readers and writers, NIO Path and Files, buffering, serialization, and the exceptions that break file code.
Oct 7, 2023


