Java
From the JVM and the first class to lambdas, records and virtual threads, Spring Boot, JPA and JUnit, Groovy and the wider JVM, the Java language and its ecosystem as told through the free samples of the Leanpub books about Java.
Created from the free samples of 24 Leanpub books and the descriptions and tables of contents of 35 more, with every source cited.
Java is a statically typed, object-oriented programming language whose source is compiled to bytecode and run by the Java Virtual Machine (JVM), which manages memory with a garbage collector and lets a program compiled once run on any operating system that has a JVM.[1] It was developed at Sun Microsystems in the 1990s under James Gosling, borrowed its syntax from C and C++ to appeal to the programmers of the day, and passed to Oracle when Oracle bought Sun in 2010.[1] Its early hold on developers, as one source lists it, came from being object-oriented from the start, doing away with pointers and manual memory deallocation, and having threads, exception handling and packaging into reusable jar files built in.[2]
Today the word covers more than the language. The platform ships twice a year, in March and September, with long-term support releases every few years, of which Java 8, 11, 17 and 21 are the ones most projects stand on;[8] Java 21 brought virtual threads, which one source calls the most important change of its release.[9] Around the language sits an ecosystem the sources describe as too large to summarise: several JVMs, three major IDEs, the Maven and Gradle build tools, the JUnit test framework, and other languages, among them Groovy, Kotlin and Scala, that compile to the same bytecode.[1] On the server, Spring Boot is the base that the library's books on web applications, security, testing, data access and AI all assume.
This article follows the subject from the language outward: where to begin, the history, the language itself, design and architecture, Spring and the web, persistence, messaging and security, testing, tools and deployment, and the wider JVM. Its sources are the free samples of the Leanpub books listed at the end, with the descriptions and tables of contents of the books whose samples were not available, and every claim that rests on a source is cited to it.
Where to start
Two sources assume no Java at all. Java For Testers is written for people approaching the language for the first time, in particular to add automation to their testing, and it inverts the usual order: every example runs as a JUnit test inside the IDE rather than as a compiled application with a main method, because, the author says, testers use Java differently and rarely build standalone programs.[3] It stops at Java 1.7 by design, so a reader should take its basics and pick up lambdas elsewhere.[3] Java Programming for Raspberry Pi needs no prior Java either and teaches the language, Maven, JavaFX and Spring Boot through Raspberry Pi hardware projects, in a 2026 edition updated yearly since 2022.[28] For a reader with some programming behind them, On Java 8 is the full textbook, 1,820 pages built around Java 8 with the features through Java 17 in marked subsections.[5] Modern Java: Second Edition is the short survey, which says basic Java helps but is not required.[1]
Once past Hello World, Java OOP Done Right takes a reader who can write variables, conditionals and classes and teaches object-oriented design in Java 11 syntax,[4] and Java Challengers reviews the fundamentals in two chapters before working through more than seventy coding challenges towards generics, streams, modules and concurrency.[27] A working developer catching up has the release guides: What's New in Java 8 for Java 8, which assumes a good understanding of Java 7,[6] From Java 11 to Java 17 and From Java 17 to Java 21 for the two long-term support jumps,[8] and JDK8 to 25 - A practical migration guide for a migration from JDK 8 straight to 25.[29] Elegant Java is a checklist of fifty-five current idioms for the same reader.[30]
On the server, Taming Thymeleaf builds a first Spring Boot web application for a beginner who has only Java,[13] Study Guide for Spring is a compact, objective-by-objective path through the framework,[37] and Spring Boot 4 In Practice is for experienced Spring developers, with an addendum for newcomers.[38] The specialist books are High-Performance Java Persistence on JDBC, JPA and Hibernate, which assumes Java, SQL and some ORM use,[10] Design Patterns in Modern Java for a reader who already knows the classic patterns,[31] Java Cryptography: Tools and Techniques for cryptography with Bouncy Castle,[47] and, across the JVM, Advanced Kotlin for experienced Kotlin developers.[18]
History
Java was first developed in the 1990s at Sun Microsystems under James Gosling, with the promise its virtual machine carried: write once, run anywhere.[2] One source credits the language's early success to a list of decisions: everything an object, garbage collection in place of pointers and manual deallocation, multithreading and exception handling in the language, and modularity through packages and jar files that a central Maven repository would later make searchable.[2]
The enterprise platform followed. Java EE, known earlier as J2EE, was Sun's attempt to make enterprise applications easy beside the desktop and mobile profiles, and both it and the language came to be specified by the Java Community Process, whose JSRs each need a reference implementation to prove they can be built.[2] Sun relicensed most of its Java technology under the GNU General Public License in May 2007, which produced open-source JVMs with OpenJDK as the official one; Oracle acquired Sun in 2010 and lost its suit against Google over Java in Android in May 2012.[1] The committee style had a counter-movement: the Grails book tells how frameworks such as Struts and Hibernate became de facto standards, and how the Spring Framework, founded by Rod Johnson, arose as a response, introducing dependency injection and reaffirming plain old Java objects against the EJB 2 of the day, after which the two evolved in parallel.[2]
The language moved in steps. Java 5 added generics, annotations, the enhanced for loop, static imports, autoboxing, enums, varargs and the concurrency utilities; Java 7 added the diamond operator, strings in switch, try-with-resources, multi-catch and the fork/join framework.[1] Java 8, in 2014, was the turn: lambda expressions, method references and default methods from Project Lambda, a Stream API, Optional, a new date and time API, the Nashorn JavaScript engine and the removal of the permanent generation from the HotSpot virtual machine.[6] The author of On Java 8, who had drifted away from the language, found something different in Java 8, as if the designers had become interested in programmer experience, and judged that backward compatibility made another change that dramatic unlikely.[5] A 2015 beginner's book could still stop at Java 1.7 and tell readers to pick up 1.8 later.[3]
After Java 9 the platform adopted a six-month cadence, March and September, each release supported only until the next with two quarterly security updates, and long-term support versions for the projects that cannot keep up: Java 8 and 11, then 17, released on 14 September 2021 and required by Spring Framework 6.[8] Java 21 followed on 19 September 2023 with virtual threads as its headline.[9] By 2026 the library's books target Spring Boot 4 on a Jakarta EE baseline,[38] guide migrations to JDK 25[29] and preview Java 26 and 27.[39]
The language
The language books divide by era: the fundamentals, which have changed little since Java 5; the functional turn of Java 8; and the features of the six-month releases, from text blocks and records to virtual threads.
Objects and the basics
The sources agree on where to begin. In Java For Testers the class is the basic building block and all code is written inside one; methods are the commands that make something happen; a package is like a directory that lets the rest of the code find the class; class names start with an uppercase letter and method names with a lowercase one; and a JUnit test is simply a method annotated with @Test that the IDE can run without creating an application.[3] Modern Java adds the mechanics: a class lives in a file named for it, anything outside java.lang must be imported, objects are passed by reference, and the eight primitives are the exception to "everything is an object", with no methods and never null.[1]
Java OOP Done Right explains what the objects are for. Its picture is people at work: a writer asks a postman to deliver a letter without saying how, and the postman is free to change the method later without the writer noticing; objects, likewise, know how to do their own job and keep their own secrets.[4] Java supports that design with a traditional language of variables, loops and conditionals plus a way to package code and data into objects, each belonging to a class that is its blueprint, and the book's glossary runs from object, class and method through constructor, field and reference to this, private for secrets and public for the few methods calling code may use.[4] Its theme, stated first, is to optimise for clarity, because programming explains to another human what the computer is doing and only as a by-product tells the computer.[4] On Java 8 adds that it points out the language's design errors so that beginners stop assuming they are the ones at fault,[5] and Java Challengers covers the same ground from encapsulation and inheritance to interfaces and exceptions, each chapter ending in a themed challenge.[27]
Lambdas, streams and functional style
Java 8's lambda expression is, in one source's words, syntactic sugar for an anonymous class with one method whose type is inferred, written as parameters, an arrow and a body, with the parameter types, the parentheses around a single parameter, the braces around a single statement and the return keyword all optional.[6] A lambda sees the variables of its enclosing scope provided they are final or effectively final, which is to say assigned once; method references name an existing static method, instance method, method on a particular instance or constructor instead; and a functional interface is any interface with exactly one abstract method, including interfaces written before Java 8, with java.util.function supplying Function, Supplier, Predicate, Consumer and their primitive variants.[6] A Practical Guide for Java 8 Lambdas and Streams goes to the specification: a lambda has no type of its own and takes one from its context, which makes it a poly expression; its body introduces no new scope; and method references come in six kinds, including super::method and the array constructor int[]::new.[7]
Both books explain default methods as the device that let a stream method be added to the Collection interface without breaking every existing implementation,[6] and the second frames them as the answer to a long-standing problem, how to evolve a published interface, since before Java 8 an interface had to be designed right the first time.[7] A class that inherits two defaults with the same name must override and choose with Foo.super.talk(), and interfaces gained static methods too, so that helpers such as Stream.of live on the interface rather than in a utility class.[6] The Stream interface represents a sequence like an Iterator but supports parallel execution, map, filter and reduce, and lazy evaluation;[6] the practical guide treats streams from the library's own concepts, Spliterator and encounter order, before its seventeen how-tos, and gives Optional a chapter.[7] The wider paradigm is in The Art of Functional Programming, whose title page gives its examples in OCaml, Haskell and Java.[25]
From Java 9 to Java 25
The two upgrade guides are organised by JEP. From Java 11 to Java 17 tables the preview-to-standard path of switch expressions, standard in Java 14, records and pattern matching for instanceof, standard in 16, and sealed classes, standard in 17, alongside the removal of Nashorn and the deprecation of the applet API and the security manager.[8] Its text blocks chapter is the one the sample shows in full: a text block is a multi-line string delimited by three double quotes, inside which quotes need no escaping; the compiler normalises line endings, strips the incidental indentation shared by every line in a re-indentation step and only then interprets escape sequences, so that at runtime a text block is indistinguishable from an ordinary string.[8] Its records chapter, by its headings, weighs records against Lombok, Kotlin data classes and Scala case classes.[8]
From Java 17 to Java 21 tables UTF-8 as the default charset in Java 18, virtual threads and record patterns arriving as previews in 19 and 20, and in 21 virtual threads, record patterns, pattern matching for switch and sequenced collections as final, with string templates, unnamed patterns, scoped values and structured concurrency still in preview.[9] On the JVM side it explains generational ZGC, added in 21 and the default from Java 23, which collects young objects more often than old ones; the Java 21 warning when an agent is loaded dynamically into a running JVM, ahead of disallowing it by default; and the deprecation of finalization, a JDK 1.0 mechanism meant as a safety net for native resources such as file handles.[9] For the application that never left JDK 8, JDK8 to 25 is a catalogue of migration failure modes, each with its symptoms, cause, detection and fix, covering API removals, changed defaults, locked-down internals and build-tool changes.[29] Elegant Java turns the modern features into fifty-five numbered practices, from records and sealed classes to Optional, java.time and sequenced collections.[30] Design Patterns in Modern Java rewrites the Gang of Four for Java 21 to 25, setting each classic implementation beside one built from records, sealed interfaces, pattern matching and virtual threads.[31] A Foojay community book closes with Java 25's compact source files and the IO class, which let Java be written as scripts.[32]
Design and architecture
Java carries more design literature than most languages, and the library's share of it runs from the shape of a single class to the boundaries between services.
Object-oriented design and clean code
Java OOP Done Right continues past the basics into behaviour-first design: hide data, shape objects with test-driven development and the Tell Don't Ask principle, and keep the calling code simple; its contents run through polymorphism, SOLID, test doubles, refactoring, hexagonal architecture, error handling with exceptions and Optionals and common mistakes, and end in a cheat sheet and code review points.[4] Clean Code Fundamentals is the single-volume version for Java: cohesion and coupling, the layered and hexagonal architectures, naming and comment rules, a JUnit 6 and Mockito primer, SOLID and all twenty-three Gang of Four patterns with Java examples.[33] The second edition of Clean Code Principles and Patterns ranges wider, from architecture and design through testing, security, API design and concurrency to DevSecOps, with examples in Java, TypeScript and C++ and only a few Java-specific sections, such as checked exceptions.[34] What to Look for in a Code Review, a 2016 collection of blog posts and the best-selling title in the Java category, frames review as questions about tests, performance, data structures, SOLID principles and security.[35]
Hexagonal architecture, domain-driven design and microservices
The second edition of Get Your Hands Dirty on Clean Architecture builds a web application in a hexagonal architecture in Java, explaining what is wrong with plain layers before implementing use cases, web and persistence adapters and application assembly with Spring, with a chapter on taking shortcuts on purpose and what each one costs.[36] Domain-Driven Design and Microservices Explained offers a litmus test: remove the controllers, application services and repositories, and the domain layer should still implement everything the business asked for, taking its input without caring where it came from and returning results without caring whether they go to a database or to Kafka; hexagonal architecture, also called ports and adapters, puts that domain in the inner hexagon and adds adapters as needed, and in CQRS the write-side model is shielded from UI and database influence while the read side follows its consumers.[22] Playing with Java Microservices on Kubernetes and OpenShift codes a Spring Boot shop as a monolith, splits it along domain lines into Spring Cloud services with Config Server, Eureka, Zipkin, Hystrix and Zuul, and then, once on Kubernetes, replaces those with ConfigMaps, Services and Ingress.[26]
Spring and the web
Spring's origin as a response to Java EE's committee style is told above; the framework the sources describe today is Spring Boot, on which Grails 3 itself was rebuilt in 2015.[2]
Spring Boot
Taming Thymeleaf shows the smallest moving parts: a controller is a plain Java class annotated with @Controller, a @RequestMapping sets its root path, a @GetMapping method takes a Model and returns the name of a template, and component scanning finds the classes annotated @Component, @Configuration, @Controller, @Service or @Repository at startup, creates them and injects their dependencies.[13] Study Guide for Spring organises the framework by exam objective, from dependency injection, Java configuration and the bean lifecycle through JdbcTemplate, transactions and Spring Data JPA to Spring MVC, method security and the Actuator.[37] Spring Boot 4 In Practice covers the 2026 generation, Spring Boot 4 on Spring Framework 7 with a Jakarta EE baseline, from auto-configuration internals through JPA, Spring Security, Testcontainers and observability to WebFlux, GraalVM native images and a migration chapter from Spring Boot 3.[38] Fullstack Dev 2027 for Java Tech is thirty-four short articles pegged to releases such as Spring Boot 4.1.0, on Spring Cloud, Jakarta EE, gRPC, OAuth 2.0 with Keycloak and JPA.[39]
Templates, REST and GraphQL
Thymeleaf is a server-side Java template engine whose templates are plain HTML files: a request is matched to a controller that builds a model, the engine combines model and template, and the browser gets HTML. Its templates are natural, in that the structure is ordinary HTML and the dynamic behaviour lives in th: attributes in an XML namespace, so a designer can style them outside the running application.[13] Modern frontends with htmx keeps that stack and adds interactivity from the server side, triggers, targets and swapping, server-sent events and websockets, worked through a TodoMVC clone and a contact application with the htmx-spring-boot library.[40]
For APIs, REST assured with JAX-RS is a short 2017 guide to the Java API for REST services pinned to JAX-RS 2.1: resources and annotations, providers, filters and exception mappers, the request pipeline, the client API and the 2.1 additions of server-sent events, JSON-B and a reactive client.[41] Programming APIs with the Spark Web Framework, from 2015, introduces the small Spark framework and then builds the same API in Kotlin and Scala.[42] GraphQL with Java and Spring, whose authors its description names as the founder of GraphQL Java and a co-author of Spring for GraphQL, runs from schema and query basics through DataFetchers, subscriptions, directives, instrumentation, DataLoader, testing and security to a Java client.[43]
Reactive programming
The history is in Reactive Programming on Android with RxJava. Ray Ozzie's 2005 memo on internet services set Erik Meijer's team at Microsoft looking for a programming model for data-intensive services, and their breakthrough was to dualise the Iterable interface of the Gang of Four's Iterator pattern into a push-based model for asynchronous streams, which became Rx.NET.[11] Jafar Husain took the idea to Netflix in 2011; Ben Christensen's team, rebuilding the Netflix API so that client teams could write their own endpoints without becoming concurrency experts, ported it to Java and announced RxJava in February 2013, and the Reactive Manifesto of the same year defined a reactive system as responsive, resilient, elastic and message-driven.[11] The book's worked example is a ten-line pipeline from subscribeOn on a background scheduler through filter, map, distinct and take to observeOn the main thread, explained operator by operator.[11]
On the server, Full Reactive Stack explains what Spring 5 added: Spring WebFlux, a non-blocking alternative to Spring MVC built on Project Reactor, which follows the Reactive Streams specification.[12] It compares that with Servlet 3.0's asynchronous support, which still blocks from the client's view, and with promise-based clients, which still wait for the whole response; in a reactive web every layer hands data on as soon as it has it, so a search result list arrives item by item over server-sent events instead of all at once, and fewer server threads sit blocked.[12] It separates asynchronous programming with callbacks from reactive programming with a Reactive Streams library, and notes that Java 9's Flow API was meant to standardise the interfaces but that most libraries kept their own classes.[12] Reactive Spring tours the Spring stack from the same premise, that JVM threads are expensive and networks faulty, across data access, the web, RSocket, testing and integration.[44] Java 21's virtual threads, which From Java 17 to Java 21 calls the release's most important change, are the platform's own answer to the thread-per-request cost that made the reactive style attractive.[9]
Persistence, messaging and security
Behind the web layer the library covers the three concerns every server has: the database, the message broker and the question of who is allowed to do what.
JDBC, JPA and Hibernate
High-Performance Java Persistence works upward from JDBC, and its sample chapter is on batching. The Statement interface batches static SQL but should be avoided for create, read, update and delete because it invites SQL injection; PreparedStatement binds parameters safely and batches many parameter sets for one statement; and the drivers differ, Oracle's ignoring batching for anything but PreparedStatement and MySQL's sending each statement separately unless rewriteBatchedStatements is set.[10] The book measured insert, update and delete across four databases and found that every one gained from prepared-statement batching, that the gain does not grow linearly with batch size so a value between ten and thirty is usually right, that a bulk UPDATE or DELETE is an order of magnitude faster than batching for large changes, and that long transactions block other writers under both two-phase locking and MVCC, so large jobs should be broken up.[10] Its later parts cover JPA and Hibernate mappings, flushing, fetching, caching and locking, and jOOQ.[10] Opinionated JPA with Querydsl weighs JPA's good, missing and questionable parts and proposes using it in a tuned-down, SQL-friendly way: Querydsl in place of the Criteria API, to-one mappings dropped in favour of ad hoc entity joins that EclipseLink and Hibernate both support, and chapters on the N+1 selects problem and mapping enums, written against JPA 2.1 and 2.2 in 2017.[45] The Spring books carry the framework side, JdbcTemplate, transactions and Spring Data JPA.[37]
Messaging and in-memory data
Effective Kafka is a 394-page guide to event-driven architecture with Apache Kafka, from producer and consumer configuration through replication, retention, group membership, security, quotas and transactions, with its client code in Java 11 and the distributed-computing theory of liveness and safety alongside.[46] The JMeter book's chapter on message-oriented middleware gives the theory in a few pages: a broker stores a message until it is delivered, so producers continue without waiting; it decouples technologies, so a Java producer can feed a C++ consumer, as well as locations and times; producer flow control implements back pressure by holding a lock until the broker acknowledges; and the models are point-to-point queues, publish-subscribe topics and fanout.[21] The Apache Ignite book describes Ignite as a memory-centric distributed database, cache and compute platform with a shared-nothing architecture: identical nodes with no master, each an Ignite process in a JVM, divided into server nodes that hold data and client nodes that act as entry points, and configured in Spring XML or Java.[19] Its chapters integrate Ignite with Hibernate as a second-level cache, with MyBatis, Spring Data, Kafka and Spark.[19]
Security and cryptography
Java Cryptography: Tools and Techniques, written by Bouncy Castle developers, covers the standard provider architecture and the Bouncy Castle APIs from ciphers, digests and signatures through X.509 certificates, key stores, CMS, OpenPGP and TLS to post-quantum algorithms, and sets out to cover what the JDK leaves out, such as certificate management and time stamps.[47] At the application layer, JavaEE Security Workshop is a 2016 cookbook of nine examples, from BASIC and form authentication through OAuth2, LDAP and JWT to securing JSF components on WildFly, from when JSR-375 was still a goal.[48] Secure All The Things! brings the same concerns to Spring Boot in 2026, with Spring Security, OAuth and a single Spring Authorization Server used to secure HTTP, MCP, gRPC, desktop, command-line and messaging workloads.[49] The fullstack collection adds OAuth 2.0 and OpenID Connect with Keycloak,[39] and the persistence book's warning against SQL built by string concatenation is the oldest lesson in the set.[10]
Testing
JUnit runs through the library from the first page of Java For Testers, where a test is a method annotated @Test,[3] to JUnit 5 Cookbook, pinned to version 5.11.4, which goes feature by feature through assertions, assumptions, tagging, nested, repeated, parameterised and dynamic tests, the extension model, migration from JUnit 4, and the JUnit Platform and Launcher.[50] Practical Unit Testing with JUnit and Mockito pairs the tools, JUnit 5, Mockito and AssertJ, with the quality of the tests themselves: recognising and fixing bad tests, code coverage and mutation testing, and exercises in every chapter.[51] Java Testing Toolbox surveys about thirty tools in short chapters, from assertion libraries and mocking to WireMock, Testcontainers, LocalStack and Gatling, with the stated aim of helping a reader choose, though nine chapters are marked upcoming.[52]
Testing Spring Boot Applications Demystified is organised by how much of the Spring context a test loads: none for a unit test, a slice with @WebMvcTest or @DataJpaTest, or the whole application with @SpringBootTest, with a closing chapter on anti-patterns and slow tests.[53] Test-Driven Development, Build Automation, Continuous Integration is one toolchain end to end in Eclipse, as its book-structure section lays out: JUnit, TDD, code coverage and mutation testing with PIT, Maven, Mockito, Git and GitHub Actions, Testcontainers for integration tests, AssertJ Swing for UI tests, Cucumber for end-to-end tests and SonarQube.[23]
TDD for Android, dated by its own authors' warning, keeps a worked example worth reading: a spike to learn the platform, acceptance tests written first and left failing, then a shift to fast unit tests in an Android-free core module that the app module depends on and never the reverse, a test list, and presenter-first design in which the presenter is driven through a mocked view interface.[20] The authors prefer JMock to Mockito because its expectations describe an interaction in one place, where Mockito's when and verify split it before and after the call.[20] For load, Master Apache JMeter is the first JMeter book by the tool's committers; its preface by Alexander Podelko records that by 2018 JMeter had overtaken LoadRunner in both documents and job postings to become the most popular load testing tool, and that its scripts had become a de facto standard which SaaS tools build on.[21]
Tools, builds and deployment
A Java program needs a JDK, an editor, a build and somewhere to run, and the library has a book for each stage.
IDEs, build tools and source tooling
Modern Java names the three IDEs, Eclipse from the Eclipse Foundation, NetBeans from Sun and then Oracle, and the commercial IntelliJ IDEA with its community edition.[1] Getting to Know IntelliJ IDEA documents the New UI of the 2023 releases, mixing tutorials with question-and-answer sections on navigating code, running, debugging, testing, Maven and Gradle, Git and refactoring, with a chapter on the AI Assistant.[54] Java For Testers installs the JDK, Maven and IntelliJ on Windows or Mac in its second chapter, because, it says, programming requires a bunch of tools before any code.[3]
Gradle Goodness Notebook is the author's blog posts, each stamped with its Gradle version and date, and the sample's Java entries span the tool's life from Gradle 0.9 to 8.5: compatibility settings, compiler encoding, passing --enable-preview to every compile, test and run task, and Java toolchains, which let a build compile and test with a different JDK from the one running Gradle, found in system locations, SDKMAN installs or a Maven toolchains.xml.[16] The upgrade guides show the Maven equivalent, a compiler-plugin configuration with --enable-preview and --add-modules for incubating modules.[8] JavaParser: Visited is tooling for the language itself: parsing Java source into an abstract syntax tree, visiting and modifying it, printing with lexical preservation so edits go back without reformatting, and resolving symbols and types, with a second part of use cases by the library's maintainers.[55]
Containers, Kubernetes and the cloud
Stratospheric's first chapter is the smallest useful deployment. Its Dockerfile is four lines, starting from the eclipse-temurin:17-jre image, which the book explains bundles OpenJDK 17 from the Eclipse Adoptium project, successor to AdoptOpenJDK and unrelated to the Eclipse IDE; the application is built with the Gradle wrapper, the jar copied in and started with java -jar, and the image pushed to Docker Hub, with Amazon's registry introduced later.[15] It then turns to AWS: a separate account for experiments, version 2 of a command-line interface that covered 224 services at the time of writing, and CloudFormation, which takes a YAML or JSON file and provisions every resource listed in it, so that a whole network with load balancers, clusters, queues and databases comes from one description.[15] Its later parts, by their contents, add Cognito, RDS, SQS, SES and DynamoDB through Spring Cloud AWS, then CloudWatch logging, metrics, alarms and canaries; the same authors sell an online course on the material.[15]
Hands-On Java with Kubernetes treats each Kubernetes concern for Spring Boot and Quarkus side by side and generates manifests and images from Java tooling, Dekorate, Buildpacks and JKube, rather than hand-written YAML and Dockerfiles, across health checks, secrets, configuration and discovery, autoscaling with Knative and KEDA, GraalVM native images and CI/CD with Tekton and Argo CD.[56] The older microservices book deploys to both Kubernetes and OpenShift with bonus chapters on Istio and Linkerd, on Java 8 and the Netflix stack of 2020.[26] Sustainability for Java Developers, from the Foojay community with twelve contributors, treats the same deployment choices as sustainability questions, modular monolith against microservices and scale-to-zero, and ends with two hands-on chapters on slimming Java containers with multi-stage builds, JLink and GraalVM native images.[32]
The wider JVM
The Java category on Leanpub holds books whose language is not Java, Groovy and Grails, Kotlin and Scala, and the libraries and platforms, from PDF generation to AI, that Java reaches.
Groovy and Grails
Apache Groovy, in the definition the Grails book quotes from its site, is an optionally typed and dynamic language with static-typing and static-compilation capabilities for the Java platform, which integrates with any Java program and adds scripting, domain-specific languages, metaprogramming and functional programming; its groovyc compiles to the same bytecode as javac, and its GDK enriches the Java classes with convenience methods.[2] Groovy began in 2003 when James Strachan wanted a dynamic language for the JVM, inspired by Ruby but closer to Java, and Guillaume Laforge has led it since.[2] Groovy Goodness Notebook is hundreds of one-topic entries from 2009 onward, each a runnable snippet checked with assertions; the sample's strings chapter shows the .& operator turning a Groovy or a Java static method into a closure, dollar slashy strings from Groovy 1.8 and the string methods the GDK adds, and newer entries cover switch expressions, GINQ and TOML builders.[17] Grails 3, in GRAILS 3 - Step By Step, is a full-stack framework on Spring Boot, Gradle and Hibernate linked by Groovy: a service is a stateless class dropped into the services folder with no annotation, a domain class needs no @Entity, and testing uses JUnit, Spock and Geb.[2] The book dates Grails to 2008, Grails 2 to 2011 and Grails 3 to 2015, follows its stewardship from G2One through SpringSource, VMware and Pivotal to OCI, and places it fifth in RebelLabs' 2017 index of Java web frameworks, just after Spring Boot.[2] Modern Java's ecosystem tour has chapters on Groovy and Scala and on Grails, Play and Ratpack beside Spring Boot.[1]
Kotlin and Scala
The Grails author gives the Groovy camp's view of Scala, quoting James Strachan that he might never have created Groovy had he seen Programming in Scala in 2003, and adding that for a Java developer Scala, Play and SBT are a big elephant to eat.[2] Kotlin's case is made by the author of On Java 8, who tells Android programmers that Java on Android is tied to Java 5 and that Kotlin, an official Android language, is the better choice.[5] Advanced Kotlin, for experienced Kotlin developers, gives its second part to Kotlin on different platforms, including Kotlin and Java type mapping and the annotations that smooth interoperability with Java, and its third to metaprogramming with reflection, annotation processing, Kotlin Symbol Processing and compiler plugins.[18] Programming APIs with the Spark Web Framework compares the three languages on one small framework, with a long Kotlin chapter,[42] and From Java 11 to Java 17 sets records against Kotlin data classes and Scala case classes.[8]
Desktop, PDF, hardware, Android and AI
Apache NetBeans Platform for Beginners, from 2014, teaches modular Java desktop applications on the Swing-based NetBeans Platform, from modules and Lookup to the window system and the Visual Library.[57] The two iText books document a PDF library that, as the second says, was written in Java and then ported to C#, which is why its interfaces carry a C#-style I prefix: IElement for the objects added to a document, IRenderer for the renderers that draw them and ILargeElement for a Table that can be flushed before it is complete.[24] The Jump-Start Tutorial is the overview, building blocks, low-level canvas drawing, renderers and event handlers, forms and editing existing PDFs,[58] and Building Blocks expands its first chapter, starting with PdfFont, the fourteen standard Type 1 fonts, embedding TrueType fonts and the encodings of Czech, Russian and Korean text.[24] Java Programming for Raspberry Pi takes the language to hardware with Pi4J for LEDs, buttons and sensors, JavaFX, JBang single-file applications and MQTT messaging.[28] Android appears through RxJava, whose event-driven platform the Rx book calls an ideal fit.[11]
Spring AI for Your Organization opens with the history of AI in Java: AIML's first widely used implementation in 1995 for the ALICE chatbot, Apache OpenNLP in 2010, Stanford CoreNLP and Deeplearning4j in 2014, and then the shift to Python when PyTorch arrived in 2016.[14] Spring AI, in its account, extends Spring's principles of portability, modularity and plain old Java objects to generative AI, with built-in conversation history, retrieval-augmented generation and a unified API over OpenAI, Google Vertex AI and Azure, so that Java developers need not switch to Python; the book builds its chatbot on JDK 17 with Gradle and the Vertex AI Gemini starter and deploys it to Cloud Run.[14] Creating AI Agents with MCP builds the same weather server in Python, Java and Node.js, the Java chapter on the MCP Java SDK 0.10.0 and Java 21,[59] the fullstack collection surveys Java AI agent frameworks including Embabel and Spring AI with pgvector,[39] and Secure All The Things! puts a Spring Authorization Server in front of an MCP server.[49]
Sources
Every source is a Leanpub book. The note after each says which part of it was read; where no sample was available, only the public description and table of contents were used.
- 1.Modern Java: Second Edition, Adam L. Davis: Java 21 and the Java Ecosystem Free sample: Part I on the Java language, from history and openness through syntax and the Java 5 to 7 features to the start of fork/join. 2025. Free sample: PDF · EPUB
- 2.GRAILS 3 - Step By Step, Cristian Olaru: Greenfield applications made right with Grails 3 Free sample: how the book is organised, the introduction to Grails 3 and its history of Java, Java EE, Spring, Groovy and Grails, and the start of the architecture section. 2017. Free sample: PDF · EPUB
- 3.Java For Testers, Alan Richardson: Learn Java fundamentals fast Free sample: the introduction on why testers learn Java differently, chapter one's tour of a class, a method and a JUnit test, and the start of the installation chapter. 2015. Free sample: PDF · EPUB
- 4.Java OOP Done Right, Alan Mellor: Create object oriented code you can be proud of with modern Java Free sample: the preface, Optimise for Clarity, and the opening chapter on what an object is, with the User class example and Tell Don't Ask. 2021. Free sample: PDF · EPUB
- 6.What's New in Java 8, Adam L. Davis: An unofficial guide to Java and JDK 1.8 Free sample: the preface and overview, the lambda expressions chapter with method references and functional interfaces, default methods, and the start of streams. 2018. Free sample: PDF · EPUB
- 7.A Practical Guide for Java 8 Lambdas and Streams, Fu Cheng: Mastering Java 8 Lambdas and Streams Free sample: the introduction, the lambda chapter from target typing through scoping and the six kinds of method reference to default methods, and the start of Optional. 2025. Free sample: PDF · EPUB
- 8.From Java 11 to Java 17, Fu Cheng: Upgrade to Java 17 LTS from Java 11 LTS Free sample: the introduction on the release schedule, the JEP tables for Java 12 to 17, installing Java 17, Maven setup, and the text blocks chapter. 2026. Free sample: PDF · EPUB
- 9.From Java 17 to Java 21, Fu Cheng: Upgrade to Java 21 LTS from Java 17 LTS Free sample: the introduction, the JEP tables for Java 18 to 21, installing Java 21, the JVM chapter on generational ZGC and agents, and the start of the deprecations. 2026. Free sample: PDF · EPUB
- 10.High-Performance Java Persistence, Vlad Mihalcea: Get the most out of your persistence layer Free sample: the JDBC batching chapter, with Statement and PreparedStatement batching, batch size, bulk operations and auto-generated keys, and the start of the JPA part. 2024. Free sample: PDF · EPUB
- 11.Reactive Programming on Android with RxJava, Christopher Arriola, Angus Huang Free sample: chapter 1 on what reactive programming is, the history of Rx and RxJava, a worked pipeline and RxJava's defining characteristics. 2017. Free sample: PDF · EPUB
- 12.Full Reactive Stack with Spring Boot, WebFlux and MongoDB, Moisés Macero Free sample: chapter 1 on the reactive web, WebFlux and Project Reactor, the case for non-blocking and the demo application. 2020. Free sample: PDF · EPUB
- 13.Taming Thymeleaf, Wim Deblauwe: Practical Guide to building a web application with Spring Boot and Thymeleaf Free sample: chapter 1 on what Thymeleaf is, a first template, a first Spring MVC controller and Thymeleaf expressions; the sample is a 2020 snapshot of a book since updated. 2026. Free sample: PDF
- 14.Spring AI for Your Organization, Muthukumaran Navaneethakrishnan: GCP Vertex AI Edition Free sample: chapter 1 on AI frameworks in Java, Spring AI, Vertex AI and setup, and the start of chapter 2 on creating the chatbot project. 2025. Free sample: PDF · EPUB
- 15.Stratospheric, Tom Hombergs, Björn Wilmsmann, Philip Riecks: From Zero to Production with Spring Boot and AWS Free sample: chapter 1 on setting up AWS, the Dockerfile and Docker Hub, and the first CloudFormation stacks; the front matter is withheld. A companion online course exists. 2024. Free sample: PDF · EPUB
- 16.Gradle Goodness Notebook, Hubert A. Klein Ikkink (mrhaki): Experience Gradle through code snippets Free sample: the Java and Groovy chapter, on compatibility settings, compiler encoding, preview features, toolchains and a mixed Java and Groovy project. 2024. Free sample: PDF · EPUB
- 17.Groovy Goodness Notebook, Hubert A. Klein Ikkink (mrhaki): Experience the Groovy programming language through code snippets Free sample: the strings chapter, from turning methods into closures and dollar slashy strings to the GDK's string methods. 2023. Free sample: PDF · EPUB
- 18.Advanced Kotlin, Marcin Moskała Free sample: the introduction with the book's structure and conventions, and the start of Part 1 on generic variance modifiers. 2026. Free sample: PDF · EPUB
- 19.The Apache Ignite book, Shamim Bhuiyan: The next phase of the distributed systems Free sample: the preface and author notes, and the start of the architecture chapter on shared-nothing topology, client and server nodes and deployment. 2025. Free sample: PDF · EPUB
- 20.TDD for Android, Matteo Vaccari, Carlo Bellettini: Time-tested tricks to do Test-Driven Development well Free sample: the Unit Doctor chapter, from the spike and acceptance tests through the shift to TDD in an Android-free module to the JMock versus Mockito aside. 2016. Free sample: PDF · EPUB
- 21.Master Apache JMeter From load testing to DevOps., Antonio Gomes Rodrigues, Philippe Mouawad, Milamber: Prefaced by Alexander Podelko Free sample: the preface by Alexander Podelko, the author biographies, and the opening theory of the JMS chapter on message-oriented middleware. 2025. Free sample: PDF · EPUB
- 22.Domain-Driven Design And Microservices Explained with Examples, Sandeep Jagtap: Learn to clarify and focus the boundaries of your system’s architecture Free sample: the section on the domain layer and hexagonal architecture; every other chapter is withheld. 2023. Free sample: PDF · EPUB
- 23.Test-Driven Development, Build Automation, Continuous Integration, Lorenzo Bettini: with Java, Eclipse and friends Free sample: the book-structure section, a paragraph on each chapter from testing and Eclipse to SonarQube and Guice, with no chapter body text. 2026. Free sample: PDF · EPUB
- 24.iText 7: Building Blocks, iText Software Free sample: the notation and interface overview, and chapter 1 on PdfFont, standard fonts, embedding and encodings. 2016. Free sample: PDF · EPUB
- 25.The Art of Functional Programming, Minh Quang Tran, PhD No usable sample: the PDF sample's text was unreadable beyond its title page; from the description and the title page. 2025. Free sample: PDF
- 26.Playing with Java Microservices on Kubernetes and OpenShift, Nebrass Lamouchi No usable sample: every chapter in the sample is withheld; from the description and table of contents. 2020. Free sample: PDF · EPUB
- 27.Java Challengers, Rafael Chinelato del Nero: Master the Java Fundamentals with fun Java Code Challenges! Become a Java Challenger! No sample: from the description and table of contents. 2025.
- 28.Java Programming for Raspberry Pi, Frank Delporte: A Hands-On Guide to Electronics and IoT Projects (2026 edition) No sample: from the description and table of contents. 2026.
- 29.JDK8 to 25 - A practical migration guide, Steve Poole No sample: from the description; the listing has no table of contents. 2026.
- 30.Elegant Java, Martin Hock: Hands-on Guide to write Clean Code in Java No sample: from the description and table of contents. 2026.
- 31.Design Patterns in Modern Java, Jitin Kayyala No sample: from the description and table of contents. 2026.
- 32.Sustainability for Java Developers, Geertjan Wielenga, Frank Delporte, Simon Martinelli, Markus Westergren, Jan Ouwens, Jan-Hendrik Kuperus, jlengrand, A N M Bazlur Rahman, Vasco Correia Veloso, Ko Turk, Hanno Embregts, Maarten Mulders: Towards an Understanding of Sustainable Java Software Development No sample: from the description and table of contents. 2026.
- 33.Clean Code Fundamentals, Martin Hock: Hands-on Guide to Understand the Fundamentals of Software Craftsmanship and Clean Code in Java No sample: from the description and table of contents. 2026.
- 34.Clean Code Principles and Patterns, 2nd Edition, Petri Silen: A Software Practitioner's Handbook No sample: from the description and table of contents. 2024.
- 35.What to Look for in a Code Review, Trisha Gee: Effective tips for reviewing code No sample: from the description and table of contents. 2016.
- 36.Get Your Hands Dirty on Clean Architecture (2nd edition), Tom Hombergs: A Hands-on Guide to Creating Clean Web Applications with Code Examples in Java No sample: from the description and table of contents. 2023.
- 37.Study Guide for Spring, Vincent VAUBAN: A study guide to master the Spring Framework fundamentals and advanced topics. No sample: from the description and table of contents. 2026.
- 38.Spring Boot 4 In Practice, Jitin Kayyala: A Complete Guide to Spring Framework 7 and Modern Spring: from your first endpoint to production, native images, and the Boot 3 → 4 migration No sample: from the description and table of contents. 2026.
- 39.Fullstack Dev 2027 for Java Tech, Vincent VAUBAN: Practical Java, Spring, Architecture, Security, AI and Modern Backend Engineering No sample: from the description and table of contents. 2026.
- 40.Modern frontends with htmx, Wim Deblauwe: Use htmx with Spring Boot and Thymeleaf to build dynamic and interactive web application No sample: from the description and table of contents. 2025.
- 41.REST assured with JAX-RS, Abhishek Gupta: speak HTTP using Java No sample: from the description and table of contents. 2017.
- 42.Programming APIs with the Spark Web Framework, Nordic APIs No sample: from the description and table of contents. 2015.
- 43.GraphQL with Java and Spring, Andreas Marek, Donna Zhou No sample: from the description and table of contents. 2023.
- 44.Reactive Spring, Josh Long: (v1.5) No sample: from the description; the listing has no table of contents. 2022.
- 45.Opinionated JPA with Querydsl, Richard "Virgo" Richter No sample: from the description and table of contents. 2017.
- 46.Effective Kafka, Emil Koutanov: A Hands-On Guide to Building Robust and Scalable Event-Driven Applications with Code Examples in Java No sample: from the description and table of contents. 2021.
- 47.Java Cryptography: Tools and Techniques, David Hook, Jon Eaves No sample: from the description and table of contents. 2025.
- 48.JavaEE Security Workshop, Rudy De Busscher No sample: from the description and table of contents. 2016.
- 49.Secure All The Things!, Josh Long: (with Spring Security) No sample: from the description; the listing has no table of contents. 2026.
- 50.JUnit 5 Cookbook, Fu Cheng: Unit Testing in Java with JUnit 5.11.4 No sample: from the description and table of contents. 2025.
- 51.Practical Unit Testing with JUnit and Mockito - 2nd edition, Tomek Kaczanowski No sample: from the description; the listing has no table of contents. 2019.
- 52.Java Testing Toolbox, Philip Riecks: 30 Testing Tools and Libraries Every Java Developer Must Know No sample: from the description and table of contents. 2025.
- 53.Testing Spring Boot Applications Demystified, Philip Riecks: Write Better Tests, Ship Faster: A Practical Guide to Spring Boot Testing No sample: from the description and table of contents. 2026.
- 54.Getting to Know IntelliJ IDEA, Trisha Gee, Helen Scott: Get up to speed on IntelliJ IDEA's New UI No sample: from the description and table of contents. 2024.
- 55.JavaParser: Visited, Nicholas Smith, Danny van Bruggen, Federico Tomassetti: Analyse, transform and generate your Java code base No sample: from the description and table of contents. 2023.
- 56.Hands-On Java with Kubernetes, Piotr Mińkowski No sample: from the description and table of contents. 2026.
- 57.Apache NetBeans Platform for Beginners, Jason Wexbridge, Walter Nyland: Modular Application Development for the Java Desktop No sample: from the description and table of contents. 2014.
- 58.iText 7: Jump-Start Tutorial, iText Software No sample: from the description and table of contents. 2020.
- 59.Creating AI Agents with MCP - Model Context Protocol, Lydia Evelyn and Bruce Hopkins: Part of the series, "The Only Book You'll Need On..." No sample: from the description and table of contents. 2025.
Further reading
Other books in the library on the same ground, not cited above.
- Jetpack Compose internals, Jorge Castillo How Jetpack Compose's compiler plugin and runtime work on Android and the JVM, in Kotlin. 2022.
- Learn Docker - .NET Core, Java, Node.JS, PHP or Python, Arnaud Weil: Be ready to create and run your containerized application next week. A short Docker primer for developers, with one section on containerising a Java application beside .NET Core, Node.js, PHP and Python. 2020.
- Discrete Mathematical Algorithm, and Data Structure, Sanjib Sinha: Major Components of Mathematics, and Computer Science Explained with the help of C, C++, PHP, Java, C#, Python, and Dart Discrete mathematics, algorithms and data structures with examples in seven languages, Java among them. 2026.