Pages

Topics

Tools

↑↓navigate↵openescclose

Java guides

Every published Java guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest Java guides

A Spring Boot jar with an empty database socket and an amber missing url plate beside a cyan properties sheet
Java

Spring Boot: Failed to configure a DataSource and no url attribute

The application never reached the database. The URL is missing, in the wrong file, or under a profile that is not active.

Spring BootJavaJDBCConfiguration
Two JDK crates of different heights with an amber mismatch plate between them and a compiler gate
Java

Maven: release version 25 not supported and where the JDK comes from

Six places choose the JDK and only one matters per build. Diagnose the release error, then pin the compiler so it cannot drift again.

JavaMavenJDKCI
A servlet container gate splitting javax and jakarta plates, red on the old side, headline JAVAX TO JAKARTA
Java

Spring Boot 4: NoClassDefFoundError javax/servlet/http/HttpServlet

Spring Boot 4 runs Jakarta only. A library compiled against javax asks for a class that no longer exists, and the stack trace hides which jar.

Spring BootJakarta EEMavenMigration
A classloader chain with a missing link and a cracked class cube, headline CLASS NOT FOUND
Java

ClassNotFoundException vs NoClassDefFoundError in Java

One is a missing lookup, the other a failed link or initialiser. The distinction decides whether you inspect a classpath or a stack trace.

JavaClassLoaderJVMDebugging
3D diagram of a JVM block with a side compartment filling with class cubes and a detached loader chain, headline METASPACE
Java

Java: java.lang.OutOfMemoryError: Metaspace

Class metadata lives outside the heap. Which limit was hit, how to find the classloader that grows, and why a container restart with exit code 137 is the same disease.

JavaJVMMemoryClassLoader
3D illustration of a jar cube stamped with a version plate rejected by an older JVM gate
Java

UnsupportedClassVersionError: Class File Version 61 vs 65

Bytecode newer than the JVM fails before main runs. --release, not -source/-target, keeps the class version and the API surface in agreement.

JavaJVMBuildDeployment
Java record block deconstructing into name, age, email, and admin components
Java

Java Record Patterns: Deconstruction, Nested Records, and switch Syntax

How Java 21 record patterns deconstruct record values, how nested patterns compose, and how guards, ordering, and exhaustiveness decide whether a pattern switch compiles.

JavaRecord PatternsPattern MatchingJava 21
Java 21 virtual threads streaming into a carrier pipe beside platform thread workers
Java

Java 21 Virtual Threads: Syntax, Thread Pools, and Concurrency

How Java 21 virtual threads are created and scheduled, why they must never be pooled, and the pinning, ThreadLocal, and resource-limit problems that decide whether they help.

JavaVirtual ThreadsConcurrencyJava 21
Comparison of Java text block and string literal syntax showing multi-line vs escaped string.
Java

Java Text Block vs String Literal: Key Differences

java text block vs string literal: Compare Java text blocks and string literals: syntax, escaping, formatting, and when each approach fits better in real code.

JavaText BlocksString LiteralsMulti-line Strings
Illustration comparing Java reference equality with the equals() method, showing two objects with matching content but different memory references.
Java

Java == vs equals: Reference vs Value Comparison

java == vs equals: Learn when to use == vs equals() in Java, covering reference vs value comparison, string interning, Integer caching, and the equals-hashCode contract.

java-equalityobject-comparisonstring-interninghashcode-contract