r/java • • Oct 08 '20

[PSA]/r/java is not for programming help, learning questions, or installing Java questions

324 Upvotes

/r/java is not for programming help or learning Java

  • Programming related questions do not belong here. They belong in /r/javahelp.
  • Learning related questions belong in /r/learnjava

Such posts will be removed.

To the community willing to help:

Instead of immediately jumping in and helping, please direct the poster to the appropriate subreddit and report the post.


r/java • • 10h ago

Datafaker 3.0 Released

Thumbnail datafaker.net
23 Upvotes

Hi all,

Thanks to the combined effort of 29 contributors, we've managed to create a new version of Datafaker, version 3.0. It's mostly compatible with Datafaker 2.x, but due to enabling JSpecify in this release, we've decided to call this a (potentially) breaking release. Java 17 is still the baseline, so no changes there, but we've managed to add some features, make it even faster, improved GraalVM support, and a whole lot of other improvements, plus we changed our website, https://www.datafaker.net/, to look slightly more modern.

Big shoutout to everyone who contributed on this! Cheers!


r/java • • 20h ago

jMolecules 2026.0 released

7 Upvotes

https://github.com/xmolecules/jmolecules-bom/releases/tag/2026.0.0


r/java • • 6h ago

New Foojay podcast about how AI changes how Java developers work

Thumbnail youtube.com
0 Upvotes

I published a new Foojay podcast. At the JFall conference in the Netherlands, I spoke with four developers about how AI changes their way of working. In this episode I play those interviews and discuss them with Anton Arhipov of JetBrains. We cover why code quality and guardrails still matter when an agent writes the code, how fast an AI proof of concept can go to production, where the next senior developers come from, what AI costs society and your wallet, whether local models are the answer, and how to use AI sessions in a way that keeps you learning.

Guests:

* Anton Arhipov - Developer Advocate at JetBrains
* Adam Bien - Independent consultant
* Maaike van Putten - Tech educator and co-founder of Java District
* Sayf Jawad - Founding member of Stichting Duurzaam AI
* Stéphane Philippart - Developer Advocate at OVHcloud  


r/java • • 2d ago

Quarkus 4.0 released!

Thumbnail quarkus.io
147 Upvotes

r/java • • 2d ago

Java4Shell Vulnerability: Update Your JetBrains IDEs, ReSharper, .NET Tools, Toolbox App, and Gateway Now

Thumbnail blog.jetbrains.com
56 Upvotes

r/java • • 1d ago

I built an open-source LLM gateway in Java 25 / Spring Boot 4: failover, caching, quotas and cost tracking behind one OpenAI-compatible endpoint

0 Upvotes
Most LLM gateways are Python or TypeScript, so I built one on the JVM: 
**Aether Gateway**
 (MIT). Point any OpenAI SDK at it and it handles provider failover (OpenAI, Anthropic, Gemini, Groq, OpenAI-compatible), caching, per-key quotas and per-request cost tracking.

Some JVM details that might interest this sub:

- 
Hexagonal modules,
 with the dependency rules enforced by ArchUnit. The core is JDK-only, and Spring stays in the adapters.
- 
WebFlux only for streaming,
 where cancellation has to reach the upstream call (client disconnects, you stop paying). Virtual threads everywhere else.
- 
Resilience4j
 circuit breakers and bulkheads per provider, plus failover for streams before their first chunk.
- 
Three test layers:
 contract tests shared between the Redis/Postgres adapters and their in-memory counterparts, Testcontainers integration tests, and a Cucumber acceptance suite that runs against both deployment modes.
- 
"Lite mode"
 swaps every store for an in-memory adapter by Spring profile, so the whole gateway runs as one container.

Try it:

docker run -p 8080:8080 -e AETHER_LITE_BOOTSTRAP_API_KEY=aeth_try_me ashishvaghelaa/aether-gateway-proxy:lite

Benchmarks are committed and reproducible, including the misses:
- Cache-hit p95 is 8.9 ms, and failover p99 is 67.92 ms.
- At 2,000 concurrent streams on 2 vCPU, 37% failed. That's not good enough yet.

I'd love feedback on the architecture and the code, and on what would make you actually use it.

GitHub: https://github.com/Ashish-CodeJourney/aether-gateway
Docs and 70-second demo: https://ashish-codejourney.github.io/aether-gateway/

r/java • • 2d ago

What happened to Societe Generale repositories?

30 Upvotes

Societe Generale published several projects on their Github profile, like the arch-unit-maven-plugin. All their repositories disappeared; luckily the source code is still available on Maven Central.

While the ArchUnit ecosystem is not the same as in 2019, and the plugin is not really needed anymore, I'm curious to understand what happened.


r/java • • 2d ago

How to use PostgreSQL pgvector with JPA, Hibernate, and Spring AI

Thumbnail vladmihalcea.com
18 Upvotes

r/java • • 4d ago

Benchmarking Java frameworks on a 512 MiB server: Spring Boot, Quarkus, Micronaut and Jex

Post image
57 Upvotes

I've been experimenting with Java applications on memory-constrained servers and have now formalized these comparisons into a reproducible benchmark.

One particularly interesting finding: despite substantial differences in memory consumption and startup time, all four stacks delivered remarkably similar p99 latency under sustained load.

The first published results compare four stacks implementing the same investment portfolio service:

  • Spring Boot + JDBC
  • Quarkus + Jdbi
  • Micronaut Data JDBC
  • Jex + Jdbi

Each application runs alongside PostgreSQL 18.7 on a 512 MiB Debian 13 VM with 1 vCPU, no swap and HotSpot 27 (-Xms16m -Xmx80m -XX:+UseG1GC).

Key results:

  • All eight runs sustained 40 requests/sec without errors or timeouts.
  • Sustained p99 latency ranged from 11.02 to 11.51 ms.
  • Sampled peak application RSS ranged from 148 to 233 MiB.
  • Application readiness ranged from 4.64 to 10.82 seconds.

The benchmark uses shared correctness checks, a versioned protocol, recorded measurements and automated report generation.

Spring Boot + JDBC is the reference implementation, and the other implementations reproduce its application behavior. The benchmark compares complete SQL-first application stacks rather than isolated framework overhead. The goal is to understand practical trade-offs under realistic resource constraints.

I'm also the author of CoilBase, which the Jex and Quarkus implementations use as a thin integration layer around Jdbi. Given its simple implementation, I expect its overhead to be negligible. It hasn't been measured separately, but I'd be happy to run an isolated comparison if there's interest.

Article: https://pvrlabs.xyz/java-performance/experiments/benchmarking-java-frameworks-512mib.html

Benchmark source: https://github.com/PVRLabs/framework-benchmarks

I'm currently considering two directions for the next comparison:

  • Add Helidon to broaden the Java framework comparison.
  • Add a Go implementation as a first cross-language comparison, opening the door to community contributions in other languages, such as Rust.

Which direction would you find more interesting? Other suggestions are welcome too.


r/java • • 5d ago

JLib Inspector v1.0.1 is out

Thumbnail i.redd.it
23 Upvotes

JLib Inspector v1.0.1 is out!

A Java agent that shows which JARs apps actually load at runtime, helpful when investigating dependency and vulnerability exposure.

This release improves dependencies, security, Maven 4 support, and CI.

https://github.com/brunoborges/jlib-inspector/releases/tag/v1.0.1


r/java • • 7d ago

Evolving the Java Language: An Inside Perspective

Thumbnail youtube.com
122 Upvotes

r/java • • 7d ago

r/java RSS feed ends Nov 13: where else do you follow Java news and discussion?

Thumbnail reddit.com
12 Upvotes

r/java • • 8d ago

Telltale signs of Vibecoding in Java?

105 Upvotes

Someone recently flagged one of my mods as being "obviously vibecoded" (which it wasn't), so I appealed the decision. just out of curiosity, what exactly are the signs people are seeing when accusing code of being vibecoded?


r/java • • 8d ago

Primitive classes in javac

65 Upvotes

https://github.com/openjdk/valhalla/pull/2691/changes

Javac is being taught about primitive classes as a preview feature. While marked as added in Java 28, I'm guessing we won't have a way to use it considering that there's no JEP even.

From reading the code:

  • primitive classes are implicitly value classes (JEP 401) (immutable, can be abstract and then optionally sealed...).
  • Implicitly static when nested like record.
  • Uniquely, the class name starts (or should start) with a lowercase, like primitive types.
  • Interfaces and enums cannot be primitive.
  • Can be generic and can implement interfaces like anything else*.
  • Unsurprisingly, all the examples are for numeric types (like complex numbers and points).

I assume that they are non-null by default because they are not reference types. I would be cautious about extrapolating from the older Valhalla models that talked about primitive classes, they might not be the same "primitive class".

*except for generic enums :(


r/java • • 10d ago

Java4Shell is a reason to use Java

Thumbnail mccue.dev
94 Upvotes

r/java • • 10d ago

Java RCE CVE-2026-114938

Thumbnail aikido.dev
275 Upvotes

r/java • • 10d ago

Calif discloses Java4Shell flaw in OpenJDK's Base64 decoder

Thumbnail runtimewire.com
128 Upvotes

r/java • • 10d ago

Regex Parser for Static Analysis

Thumbnail google.github.io
15 Upvotes

This is a parser that I created a while back, in order to build some regex static analysis tools (detecting ReDos, validating supported regex features etc.).

I built it because I didn't find an OSS regex parser that produces and exposes the AST for custom analysis (the regex engines I looked at all keep their parser internal, and only execute the regex).

The parser supports advanced features such as back references, lookarounds, unicode properties, posix char classes, inline and global comment mode (a.k.a free-spacing mode) etc.

Using it with pattern matching is easy:

switch (RegexPattern.of("\\w+:\\d+")) {
  case Sequence(var elements) -> ...;
  case Alternation(var alternatives) -> ...;
  ...
  default -> ...;
}

To keep it simple, A few obscure features are omitted: such as \12 being parsed differently depending on the number of capture groups defined (\1 followed by literal 2 if no 12 capture groups are present).

The code is combinator-based, mostly pair-programmed by AI and me. It's actually what I built the dot-parse library for: to be able to have AI do the chores of generating readable parser for the wide surface area and arcane regex grammar rules; so I don't have to get a degree in regex.

It has served the purpose of static analysis well.

Feedbacks are welcome!

javadoc

repo


r/java • • 11d ago

Valhalla: On the use of == on value types

Thumbnail humanoid-readable.claude-martin.ch
42 Upvotes

Java 28 has a preview on value types, so I tested it. In this blog post I answer the question:
Can we use == on the new value types, or do we still have to use Objects.equals()?

(No ads, written by a human.)


r/java • • 11d ago

Announcing r/foojay, a home for articles from the Foojay.io (Friends Of OpenJDK) community

47 Upvotes

Hi r/java,

Thanks to the mods for letting me post this here.

I’m Frank Delporte, and I help run Foojay.io, the “Friends of OpenJDK” community site. Every day, community authors publish one or more new articles there. Topics include core Java, JVM internals, frameworks, tooling, performance, cloud and containers, and much more. Some are vendor-neutral while some are tied to a product, but we try to minimize advertisement-like posts.

I’ve created a small, separate subreddit, r/foojay, for people who want to follow those articles without waiting for the occasional share here. It’s brand new and empty, so nothing is lost if you skip it. Each new Foojay article will get a summary and link to the original on r/foojay, so r/java won’t get a post for each one.

If something of my own content is a good fit for r/java, I’ll follow the rules here and post it as a normal submission, like I did in the past weeks with new podcast episodes.

r/foojay is also open for discussion, feedback, and article ideas. If you’d like to write for Foojay, that’s the place to ask, or go directly to https://foojay.io/today/how-to-submit-your-next-article-on-foojay-io/.

If this sounds useful, you’re welcome to join: https://www.reddit.com/r/foojay/

Thanks, and happy reading and coding!
Frank


r/java • • 12d ago

Apache Netbeans IDE version 32 released

Thumbnail netbeans.apache.org
107 Upvotes

r/java • • 12d ago

Why It Takes 3000 Commits to Bring Valhalla’s Value Objects to the JDK - YouTube

Thumbnail youtube.com
78 Upvotes

r/java • • 11d ago

I rewrote Spring PetClinic without Spring Boot. The forms were harder than the database.

0 Upvotes

I've been running Java performance experiments comparing different frameworks and runtime configurations. One recurring challenge was keeping business logic portable and preserving a familiar Spring-style application structure while switching between frameworks.

That's partly why I developed CoilBase, a lightweight, SQL-first Java framework. I wanted to retain familiar controllers, services, repositories and constructor wiring without depending on the full Spring Boot stack.

To put that approach to a more realistic test, I rewrote Spring PetClinic using CoilBase, Avaje Jex, Jdbi and JTE.

What surprised me was that replacing Hibernate with explicit SQL was relatively straightforward. Controllers, services, repositories and constructor wiring remained familiar. Transactions became explicit, but the overall architecture didn't change that much.

The harder part was everything around HTML forms: validation, rejected input, sessions, CSRF, flash messages, redirects and localization. Spring MVC handles a lot of these details for you.

For example, invalid POST submissions needed explicit handling to preserve form input and validation errors, including returning HTTP 200 instead of the generated adapter's default 201.

But there's an important distinction here: I deliberately preserved much of PetClinic's existing behavior. If I were building a new application, or switching frameworks while still developing a prototype, I wouldn't necessarily reproduce all those conventions. I'd choose simpler patterns where appropriate.

That's where I see lightweight frameworks like CoilBase fitting best. Not as drop-in Spring Boot replacements, but as alternatives when you're still free to make architectural choices.

The measurements:

  • Spring PetClinic: 304.4 MiB median application RSS
  • CoilBase PetClinic: 125.9 MiB (59% less)
  • Complete uncompressed deployment: 85% smaller
  • Database-backed first response: 19.76s vs. 2.63s median

Versions used:

  • Spring: Spring Boot 4.1.0, Hibernate 7.4.1.Final
  • Rewrite: CoilBase 0.1.0-preview4, Avaje Jex 3.6, Jdbi 3.55.0, JTE 3.2.4
  • Runtime: Temurin Java 25.0.4.1+1, PostgreSQL 18.6

Both applications ran on a 1 vCPU / 1 GiB Linux VM without swap, using HotSpot with the same heap settings (-Xms64m -Xmx256m).

These are measurements of two complete application stacks, not isolated framework overhead. The RSS result comes from one short workload per application, and the startup medians are from three launches each. I didn't benchmark a tuned Spring JDBC version of PetClinic or concurrent throughput.

Article and implementation:

https://pvrlabs.xyz/articles/coilbase-petclinic-rewrite.html

https://github.com/ejboy/coilbase-petclinic

Raw experiment data, measurement scripts and reproduction notes:

https://github.com/ejboy/coilbase-petclinic/tree/main/benchmark

The main takeaway for me is that keeping the familiar Java application structure is quite feasible without Spring Boot. But you have to decide which framework conveniences you actually need, and which responsibilities you're willing to own yourself.

I'm curious how other Java developers approach that tradeoff, especially for smaller services or applications still under development.

Update / clarification: Based on some of the comments, I want to clarify that this isn't a recommendation to replace Spring Boot/JPA with my framework, or to build your own framework for every project.

The broader point is that Spring Boot + Hibernate/JPA shouldn't necessarily be the default choice for every Java application. For smaller services or resource-constrained environments, it's worth considering lightweight architectural blueprints built from established libraries such as Jdbi and Jex/Javalin.

This experiment was about testing whether that approach could preserve a familiar, maintainable application structure while reducing resource usage. It's an alternative worth exploring, not a universal recommendation or a drop-in replacement for Spring Boot.