Best of JavaApril 2026

  1. 1
    Article
    Avatar of newstackThe New Stack·6w

    In the AI Age, Java is More Relevant Than Ever

    Java is positioned as a strong choice for AI development in enterprise environments, not just Python. The JVM's runtime efficiency makes it cost-effective for AI workloads where budget spent on compute competes with token costs. Frameworks like LangChain4j, Spring AI, and embabel bring first-class AI capabilities to Java. AI coding assistants like GitHub Copilot and Cursor are now highly proficient at Java, especially with popular frameworks like Spring Boot. Java's verbosity becomes an advantage in the AI age since AI-generated code is easier for developers to read and review. AI agents are also enabling continuous modernization of legacy Java codebases, turning a historically expensive one-off project into an ongoing process. Microsoft's JDConf is highlighted as a venue for Java practitioners to explore AI-in-Java topics.

  2. 2
    Article
    Avatar of foojayioFoojay.io·6w

    Does Java Really Use Too Much Memory? Let’s Look at the Facts (JEPs)

    Java's reputation for excessive memory usage is largely outdated. Modern Java has introduced significant improvements: ZGC and Shenandoah for low-latency GC, virtual threads (JEP 444) reducing per-thread memory from ~1MB to KBs, compact object headers (JEP 450) shrinking object sizes, Class Data Sharing for reduced footprint across JVM instances, and proper container awareness. Practical code examples show that most real-world memory problems stem from developer mistakes like unbounded caches or excessive platform threads, not the JVM itself. Upcoming features like Project Valhalla promise further improvements.

  3. 3
    Article
    Avatar of infoqInfoQ·5w

    Java News Roundup: JDK 27 Release Schedule, Hibernate, LangChain4j, Keycloak, Helidon, Junie CLI

    Weekly Java ecosystem roundup covering: JEP 532 (Primitive Types in Patterns) elevated to Candidate status for a fifth preview; JDK 27 proposed release schedule targeting General Availability on September 14, 2026; Hibernate ORM 7.3.0.Final with new KeyType enumeration and NaturalIdClass annotation; LangChain4j 1.1.0 with persistable/recoverable agentic execution state; Keycloak 26.6.0 adding full RFC 7523 JWT support and experimental MCP authorization server support; Helidon 4.4.1 maintenance release; a CVE in Spring Cloud Gateway where SSL bundle configuration was silently bypassed; Google ADK for Java 1.1.0 with Gemma model support; and JetBrains Junie CLI now auto-detecting and connecting to installed JetBrains IDEs.

  4. 4
    Article
    Avatar of foojayioFoojay.io·4w

    Spring Boot 3.5 EOL — The CVE Blind Spot Nobody Talks About

    Spring Boot 3.5 reaches end of open-source support on June 30, 2026, but the real risk isn't the migration — it's what happens to CVE reporting afterward. Once a project goes EOL, security researchers stop filing reports against it, maintainers stop triaging, and the CVE pipeline dries up. Vulnerabilities don't disappear; they just stop being recorded. Bad actors exploit this gap by testing CVEs found in supported branches against EOL versions that will never receive patches. Spring Boot 2.7's post-EOL trajectory (e.g., CVE-2024-38807 with no open-source fix) illustrates the pattern. Teams still on 3.5 after June 2026 risk running what the author calls 'zombie dependencies' — technically present, functionally dead from a security standpoint, with scanners showing green while hidden vulnerabilities accumulate. The advice: assess the 3.5-to-4.0 migration scope now, before the silence sets in.

  5. 5
    Article
    Avatar of baeldungBaeldung·4w

    Introduction to Spring Data AOT Repositories

    Spring Data AOT Repositories is a new feature coming in Spring Boot 4 that shifts repository preparation from runtime to build time. Previously, Spring Data used runtime reflection and dynamic proxies to implement repository interfaces via SimpleJpaRepository. With AOT Repositories enabled, Spring generates concrete repository implementation classes (e.g., UserRepositoryImpl__AotRepository) at compile time, eliminating most runtime reflection and proxy overhead. The article walks through the evolution across three modes: no AOT, AOT without repository optimization, and full AOT Repositories. Performance benchmarks show startup time improvements (10.1s → 9.9s → 8.7s) and faster build times come at the cost of longer compile times (11s → 17s → 25s). A notable benefit is compile-time detection of JPA query errors. The feature is enabled by setting spring.aot.repositories.enabled=true alongside spring.aot.enabled=true.

  6. 6
    Article
    Avatar of infoqInfoQ·4w

    Java News Roundup: OpenJDK JEPs, Jakarta EE 12, Spring Framework, Micrometer, Camel, JBang

    Weekly Java ecosystem roundup covering: JEP 534 (Compact Object Headers by Default) and JEP 533 (Structured Concurrency 7th Preview) elevated to Candidate status; JDK 27 Build 18 early-access; Jakarta EE 12 milestone timeline through Q1/Q2 2027; Spring Framework 7.0.7 and 6.2.18 with three CVE fixes (DoS vulnerabilities in WebFlux and MVC); Spring Data 2026.0.0 RC1; Apache Grails 7.1.0; Micrometer Metrics 1.17.0 RC1; Eclipse Store/Serializer 4.1.0 beta1; Apache Camel 4.19.0 with Azure Functions, Groovy JSON, Spring AI Image components and quantum-safe TLS; and JBang 0.138.0 with WAR file execution support.

  7. 7
    Article
    Avatar of jetbrainsJetBrains·4w

    IntelliJ IDEA 2026.1.1 Is Out!

    IntelliJ IDEA 2026.1.1 is a bug-fix release addressing several issues: WSL Python SDK setup is restored, Emmet works correctly in remote development, Gradle sync no longer fails with a class cast error, WildFly server connection is fixed, WSL 2 JDK detection is resolved, Ant target double-click now runs correctly, Spring project code completion is faster, WebLogic run configuration creation is fixed, and Find and Replace works properly on Enter.

  8. 8
    Article
    Avatar of baeldungBaeldung·5w

    Getting a Cron Expression From Database for a Spring Boot Scheduled Job

    Two approaches for loading cron expressions from a database in Spring Boot are compared. The first uses a Spring bean (cronLoader) referenced via SpEL in @Scheduled, which is simple but only reads the value once at startup. The second uses SchedulingConfigurer to register a trigger task that re-reads the cron expression from the database before each execution, enabling runtime schedule changes without restarting the application. An H2 in-memory database with JPA is used for demonstration, along with a REST endpoint to update the cron value on the fly.

  9. 9
    Article
    Avatar of baeldungBaeldung·6w

    Multi-Factor Authentication in Spring Security 7

    Spring Security 7 introduces native multi-factor authentication (MFA) support using a factor-based authority model. Each successful authentication step grants a FactorGrantedAuthority to the user's security context. The new @EnableMultiFactorAuthentication annotation enables MFA globally, while AuthorizationManagerFactory allows applying MFA rules to specific endpoints. The post covers global MFA setup, endpoint-specific rules, time-based re-authentication requirements, user-based conditional MFA, and unit testing MFA flows with Spring Security test utilities.

  10. 10
    Article
    Avatar of foojayioFoojay.io·3w

    Dockerizing a Java 26 Project with Docker Init

    A step-by-step guide to containerizing a Java 26 Spring Boot project using Docker Init, the interactive wizard introduced in Docker Desktop 4.27. Docker Init automatically generates a multi-stage Dockerfile, compose.yaml, .dockerignore, and README. The guide covers project setup via Spring Initializr, running docker init, understanding the generated four-stage Dockerfile (dependency resolution, compilation, Spring Boot layer extraction, and minimal runtime image with a non-root user), and a workaround for Java 26 base images using SAP Machine instead of Eclipse Temurin while the latter catches up. A simple REST controller is added to verify the running container.

  11. 11
    Article
    Avatar of neilmaddenNeil Madden·4w

    Java sealed classes and exhaustive pattern matching

    Java sealed classes enable exhaustiveness checking in switch expressions, letting the compiler verify all subtypes are handled without a default clause. However, there's a critical caveat: if a sealed type gains a new subtype and consumers aren't recompiled, a runtime MatchException is thrown instead of a compile-time error. This makes sealed types most valuable for internal component use where everything is recompiled together, but potentially problematic in public APIs — adding a new subtype becomes a breaking change that may only surface at runtime for consumers using older compiled code.

  12. 12
    Video
    Avatar of codeheadCodeHead·3w

    The Second Coming Of Java?

    Dart is compared to Java through the lens of history and platform ambition. Both languages share the 'write once, run anywhere' philosophy, but Dart found its identity through Flutter in 2018, much like Java found its enterprise identity through Spring. While Dart will never replace Java in enterprise or server-side contexts, it has captured the mobile-first battlefield where developer mindshare increasingly lives. Kotlin is Java's true heir on Android, but Dart carved out its own niche by targeting cross-platform mobile, web, and desktop development at the right moment.

  13. 13
    Article
    Avatar of cncfCNCF·4w

    From public static void main to Golden Kubestronaut: The Art of unlearning

    A Java developer's decade-long journey from monolithic enterprise development to achieving the CNCF Golden Kubestronaut designation. The author reflects on the mental shifts required: abandoning monolith instincts, embracing horizontal scaling over vertical scaling, and accepting that reliability must be designed rather than hoped for. Key advice includes starting with conceptual foundations (KCNA) before memorizing kubectl commands, deliberately breaking things in safe environments, and engaging with the CNCF community. The post also touches on the emerging shift from automated ops to agentic ops, where engineers define goals and constraints for self-governing systems rather than fixing failures reactively.

  14. 14
    Article
    Avatar of baeldungBaeldung·7w

    JMOD File Format in Java

    JMOD is a Java packaging format introduced with the Java Platform Module System (JPMS) in Java 9. Unlike JAR files, JMOD files are designed for compile and link time only — they cannot be placed on the classpath at runtime. They support native libraries, configuration files, and legal notices in addition to compiled classes. A practical walkthrough shows how to create a modular Java application, package it as a JMOD file using the `jmod create` command, and then use `jlink` to produce a custom minimal Java runtime image (~35 MB vs 400+ MB for a full JDK) containing only the required modules.