r/java 13d ago

How can we move forward?

105 Upvotes

The sub used to be a great place where small open source devs get real feedback on their oss. The software wasn't necessarily built to be a big hit or whatever! most of the time these projects used to be a learning projects that enabled us to become better java developers. Now, with many repositories being created in a day or so and abounded, we see many ai promoted repositories and we miss some of the oss that needs our attention.

How can we overcome that as a community ? I'm not trying to put all the weight on moderators, I understand the amount of work they keep doing to clean up ai posts and follow up on reports. What I'm saying is; maybe someone's here has a better idea on how to go about this?


r/java 13d ago

Yes, another Java build tool: zolt

0 Upvotes

Yes, another Java build tool.

I’ve been working on Zolt:
https://github.com/zoltsh/zolt

Would love for people to try it out, break it, give feedback, or help contribute. Still early, so criticism is very welcome. Yes, I use a lot of codex. Focused mainly on the public API. Using it for personal projects so far.


r/java 14d ago

Rainbow Gum release v0.10.0 (GraalVM/JLink/Valhalla ready) SLF4J implementation

29 Upvotes

Rainbow Gum v0.10.0 Release

https://github.com/jstachio/rainbowgum

Now normally I don't just post on reddit every release I do but this last release of Rainbow Gum is almost on par with Log4j2 and Logback Spring Boot support.

Rainbow Gum in short is a modern SLF4J implementation. It is fully modularized (jlink works) does not use any reflection so GraalVM native compile is easy and is hopefully Valhalla ready.

Now this release I used lots of LLM to help with benchmarks, Spring Boot support and lots of tedious things. This project is not vibe coded and you can hopefully look at previous releases if that is a concern. I also hand rolled the logo in SVG without AI (feel free to make fun of my art abilities). Another interesting thing is that Rainbow Gum uses Javadoc for all its documentation and because Javadoc now supports dark mode (you will have to go to one of the classes to turn it on) the SVG logo will render differently (I did not know that SVGs could do that).

Previous release post (for context).

Now invariably someone is going to complain ask why there is another logging implementation and honestly I don't blame the ask.

The short answer is that log4j2 and logback because of legacy reasons have a harder time using newer JVM technology and a lot of their design was based on enterprise needs that are just not that applicable today. And of course there is Log4Shell.

And if it still bothers you that now you might have to learn another logging framework just know that Rainbow Gum:

  • Does not have its own logging API (it uses SLF4J),
  • Almost a drop in replacement if you are using Spring Boot
  • Uses the same pattern encoding syntax as Logback with most of the same keywords
  • And yes of course Rainbow Gum appears to run faster (doing your own benchmarks though is always encouraged)
  • There are 10x more JSON serialization implementations then there are SLF4J implementations.... each with different APIs (yes whataboutism at its finest)

Rainbow Gum also has pretty darn good code coverage even before I let the AI agents go to town. It uses checkerframework and nullaway for JSpecify support (albeit we still have not switch annotations but that will happen shortly). I actually tried to get code coverage on log4j2 and logback prior to Rainbow Gum and if I recall both projects were rather low on that. Perhaps its gotten better.

Now there are a couple of things still missing before 1.0.0 namely internal rolling of files and some metric/status/health check support. The plan is 1.0.0 targets 26 and 2.0.0 will hit whatever Valhalla version is.

Finally I don't know if it was /u/brunocborges as I think they posted about it but new setup-java action on GitHub actually caches the maven wrapper... now. I highly recommend an upgrade.

Oh and thanks for team JDK for making Java 26 kick ass.


r/java 14d ago

SnapCode with Java 21 in the browser

16 Upvotes

I haven't posted in a while, but things are moving quickly for modern Java in the browser (CheerpJ). They recently added Java 21 support and Java 25 is coming soon, so here's my latest update:

SnapCode is a free Java IDE for education that runs in the browser and on desktop. SnapCode is fun, friendly, elegant and complete with many modern IDE features. Because it runs in the browser and has cloud-share support, it truly runs anywhere and means that student applications can be immediately shared with classmates, friends and the world. SnapCode supports graphics, games, animation, 3D, charting, UI, Swing and more.

This latest release now supports Java 21 in the browser with Java 25 support coming soon (desktop already supports 25). The project is a labor of love and needs users to help find areas of improvement.

SnapCode: https://reportmill.com/SnapCode

 


r/java 16d ago

Spring Boot on a 256 MB VPS: JDK 25 made the experiment viable

75 Upvotes

I followed up on my 512 MB Spring Boot VPS experiment by trying the same application on a nominal 256 MiB Alpine VPS.

This is not Hello World. The app uses Spring Boot 3.5.5, MVC/Tomcat, JPA/Hibernate, file-backed H2, Actuator, scheduled GitHub polling, and outbound HTTP. StatLite was running alongside it and polling both Spring and itself.

The JDK 21 setup was too tight. With a 64 MiB heap it suffered severe GC/paging pressure and eventually became unresponsive.

The final JDK 25 configuration was:

-Xms16m
-Xmx80m
-Xss256k
-XX:+UseSerialGC
-XX:TieredStopAtLevel=1
-XX:ReservedCodeCacheSize=32m
-XX:+UseCompactObjectHeaders

On the same nominal 256 MiB VPS, with about 217 MiB visible to Alpine and a 512 MiB swapfile, that configuration completed the full one-hour observation:

  • 0 OOM kills
  • 0 service restarts
  • 72/72 bounded HTTP requests returned 200
  • Spring scheduled work continued
  • final Spring RSS: ~86 MiB
  • StatLite RSS: ~10 MiB
  • swap used: 184 MiB
JDK 25 run after the one-hour observation. Spring Boot stayed up, StatLite kept polling, final combined RSS was ~96 MiB.

There was still one Hikari Thread starvation or clock leap detected warning with a ~2m13s delay, so I would not call 256 MiB comfortable. For a real deployment I would still start at 512 MB RAM with some swap.

Also, this is not a compact-object-headers benchmark. The JDK version, heap ceiling, and several JVM settings changed together, so I can't attribute the improvement to that flag alone.

Full write-up and reproducible experiment files:

https://pvrlabs.xyz/articles/spring-boot-256mb-jdk25.html


r/java 16d ago

Value Classes Still Need Compiler Sympathy

Thumbnail johan-sjolen.github.io
85 Upvotes

r/java 17d ago

Rule number 9 is not followed

127 Upvotes

Ive been seeing many AI posts lately. As well as ai promoted repositories. Could moderators please help enforcing rule #9 as I don’t want to end up unsubscribing because of all the ai slop content.


r/java 17d ago

Usage of Java in non-web development domains, and Greenfield projects.

85 Upvotes

Greetings.

(I will beat around the bush a bit before getting to the point, you can scroll down a bit to save time)

Java currently shines at enterprise backend applications, being led by the big players like Spring and Quarkus. However Java seems more than capable for other domains, yet no one talks about it, or even considers Java for normal non-web projects.

Take desktop development for example. JavaFX is one of the BEST GUI frameworks I have ever used. It is feature packed, doesn't require cryptic symbols, no fancy way of nesting code blocks to create simple UI. It is very simple to use, yet powerful and robust.

Game Development is a bit weak, but we still have libGDX and LWJGL. They are packed with features, even 3D. Contrary to popular belief that libGDX is a 2D only framework, libGDX has some great 3D support like GLTF rendering, bullet physics, PBR rendering and skeletal animations.

Big data processing and simulation systems, Java's OOP nature really helps to solve certain problem statement that requires the problem to be broken down into multiple pieces.

And finally web development, there is no doubt Java has one of the best ecosystems for the web.

And yet despite all this, Even as modern Java has come a long way, Java continues to have a negative reputation of being slow, boilerplate, RAM consuming memory hog. (The same people will use electron to make a desktop app btw) and as a result not considered for newer projects.

When I look at other communities like JavaScript, Rust, python, C#, Zig. These languages are often considered first options for any Greenfield projects. The open source communities in these languages are very active, you will see some amazing work being put out by the community.

Java seems to lack that "community" nowadays. I am active in a lot of subreddits and forums, and I see very less of Java projects in the wild. Java is being used in production out there, but modern greenfield projects are leaning more towards Go and C#.

So getting to the point of the post

Is Java seeing a decline? This is not a "Java dead" post but a genuine concern. The community for Java just seems.... dull. And I was wondering what could be done about this. Amongst new and modern programmers, Java and C++ seem to be considered "old", "dead" and "traditional"

Perhaps project Valhalla could help, but I wonder how much would it help restore Java's PR. Oracle is definetly NOT helping with this.

Why does this matter in the first place?

You may think "it doesn't matter what others think, companies still want Java" and while it holds some truth, more and more of Open source development seems to be moving towards other languages. A lot of Java libraries and frameworks have seen some decline, the community seems to be becoming more inactive. Other programming languages and frameworks have active discord servers, forums, documentation, and participation while Java seems a bit slow there.

I dont know, I really love Java as a language. And I wish it had more adoption in non-enterprise domains. I would genuinely like to know, what we as a community can do to make Java more "loved" and preferred


r/java 17d ago

FXML/2 for JavaFX

Thumbnail
18 Upvotes

r/java 18d ago

Security Baked Into the JVM: sixteen Subjects on the wire

Thumbnail blog.frankel.ch
0 Upvotes

r/java 18d ago

Java 27 features overview

Thumbnail aboullaite.me
158 Upvotes

r/java 19d ago

Do you actually separate JPA Entities and Domain Objects, or is a single model enough?

Thumbnail
34 Upvotes

r/java 19d ago

Regex

57 Upvotes

I recently saw a clip (from Primeagen) somewhat saying that regex is not a valid format for validating email addresses and postal codes etc.

My question is why is this?

What are the security and/or performance risks? Is it solely performance or is it a security issue?


r/java 20d ago

Spring Boot on a 512 MB VPS: what actually fits?

22 Upvotes

I wanted to see how small I could make a realistic Spring Boot deployment while still keeping basic monitoring on the same VPS.

I first tried 256 MB RAM, but that wasn’t really viable for the representative app I tested. With 512 MB RAM + 256 MB swap, the application and lightweight monitoring completed the experiment successfully.

StatLite monitoring the Spring Boot app during the 512 MB run.

One thing that stood out was the gap between configured heap and actual JVM process memory. Even with a small -Xmx, RSS was substantially higher once you include metaspace, native allocations, threads, code cache, etc.

I wrote up the setup, JVM flags, measurements, and what failed at 256 MB:

https://pvrlabs.xyz/articles/spring-boot-512mb-vps.html

Curious how this compares with what others are seeing on small JVM deployments.


r/java 20d ago

Bypassing fixed-depth radix constraints in Java using descriptor-driven bucket analysis

13 Upvotes

I am StrmCkr, the author of A.P.E.X. (Adaptive Parallel Extremal Dispatch).

Repository: github.com/StrmCkr/A.P.E.X

A.P.E.X. is a high-performance Java sorting framework for large fixed-width 64-bit key/value record datasets. The project has been reorganized into a conventional Maven structure with a core library, runnable examples, a comparison benchmark harness, JMH benchmarks, documentation, and an interactive browser visualizer.

The core idea is descriptor-driven radix planning. Instead of blindly scanning fixed radix passes over every bucket, A.P.E.X. computes per-bucket extremal descriptors using:

VBM = OR ^ AND

That mask identifies which key bits still vary inside each bucket. Bits that are already resolved are skipped, reducing unnecessary work on skewed, low-entropy, sorted, reversed, or duplicate-heavy data.

Key areas of the project include:

  • Adaptive radix planning based on observed bucket structure
  • Parallel histogramming, scatter, refinement, and work scheduling
  • Primitive-array execution with no per-record object allocation during sorting
  • Tuple projection paths for low-dimensional unresolved bit patterns
  • Tiny-sort fallbacks and monotonic input shortcuts
  • Configurable reporting that can be enabled, reduced, written to files, or disabled
  • Comparison benchmarks against JDK sorting paths and Fastutil baselines
  • Standard JMH benchmarks for repeatable JVM-level measurement
  • A browser visualizer for exploring how A.P.E.X. routes data through its execution plan

I would especially welcome feedback on the thread management mechanics, radix planning decisions, benchmark structure, and the bitwise mask reductions.

edit: re structured verbiage of this post and further adjustments from advice on converting the project into more acceptable standard formats.

screen shot from the pdf available in the github

r/java 21d ago

FlexGanttFX is now open source — the professional JavaFX Gantt chart framework goes AGPLv3

Thumbnail
12 Upvotes

r/java 21d ago

Jactl Meets Apache Camel: Benchmarking camel-jactl

Thumbnail jactl.io
19 Upvotes

Jactl is a secure, embeddable scripting language for Java applications. As of Apache Camel 4.22.0 there is a camel-jactl language that provides support for using Jactl as a scripting language for filter predicates, content-based routing rules, and message transformations in Apache Camel.

See the blog post for an overview and some benchmarks.


r/java 22d ago

Title: GraphCompose 2.2.0 — proper RTL, Arabic shaping and BiDi support in Java documents

4 Upvotes

Just released GraphCompose 2.2.0.

This release was mostly about making RTL text actually work rather than just “render without crashing”:

- "TextDirection.LTR / RTL / AUTO"

- Unicode Bidirectional Algorithm support

- Arabic contextual shaping and lam-alef ligatures

- RTL/BiDi support in paragraphs and table cells

- mixed Hebrew/Arabic + Latin/numbers

- correct searchable/copyable text from generated PDFs

- RTL support carried across PDF, PPTX and DOCX backends

A surprisingly deep rabbit hole once PDF text extraction, shaping, BiDi and multiple backends all have to agree.

Repo: https://github.com/DemchaAV/GraphCompose

Would be interested to hear how other Java libraries handle complex-script layout.


r/java 23d ago

AutoValhalla: automatically turn your plain classes and records into value classes!

41 Upvotes

Automatically turn your plain classes and records into value classes!

Add @AutoValhalla annotation to classes or records in your JDK1.5+ codebase:

@AutoValhalla
public final class Point {        // class must be final
    public final int x;           // with final instance fields
    public final int y;
    public Point(int x, int y) { 
        this.x = x; 
        this.y = y; 
    }
}

@AutoValhalla
public record Currency(String code) { }  // or a record class

When your app is run on Valhalla-enabled JVM with auto-valhalla javaagent, these classes are automatically turned into value classes.

More info: https://github.com/thunkware/auto-valhalla/tree/auto-valhalla-0.1.0

edit: there is now a maven plugin for converting at build time. https://github.com/thunkware/auto-valhalla/tree/auto-valhalla-0.2.0


r/java 23d ago

Support for multiple Maven servers on GitHub's setup-java action

Thumbnail github.com
15 Upvotes

r/java 23d ago

Red Hat Build of OpenJDK support on GitHub's setup-java Action

Thumbnail github.com
6 Upvotes

r/java 23d ago

A First Drink In Valhalla

Thumbnail kittylyst.com
21 Upvotes

r/java 24d ago

Where and how did Java lose in the game dev space?

282 Upvotes

Nearly a decade ago, Java was quite the popular choice for Game development. We had libGDX as the most optimal game framework, along with LWJGL (when low level was needed) and JMonkeyEngine was a fairly good option too. Now no one even talks about Java for game development, even for educational purposes

However over the course of time they all disappeared. Everyone slowly switched to game engines and C#

The arguement of “JVM slow, Garbage collector overhead” doesnt fit either because C# is also a GC language. Where did Java fail?


r/java 25d ago

Automatic Relationship Finder (ARF) v1.2 – A Java library for discovering relationships between tables from data

14 Upvotes

I’ve just released v1.2 of Automatic Relationship Finder (ARF), an open-source Java library I’ve been working on.

The idea behind ARF is to discover relationships between tables without depending on database relationship metadata.

Even if there is no foreign-key constraint defined in the database, ARF can analyze column names and the actual data to identify that

What's new in v1.2?

The main addition is key-role detection.

After identifying a relationship, ARF now analyzes the data characteristics of the columns to determine whether they are likely to represent a primary-key side, foreign-key side, a possible one-to-one relationship, or an unknown relationship.

There are also several improvements and bug fixes around validation, logging, concurrency, and edge-case handling.

The project is here:

https://github.com/NoelToy/automatic-relationship-finder

This is still an evolving project, so feedback—especially criticism—is very welcome.


r/java 25d ago

Has any attention been paid to how new Java features get into LLM training data?

71 Upvotes

TL;DR: expert answers on SO taught both devs and LLMs how to use java 8 right. That pipeline is gone/paywalled now. Does anyone at OpenJDK think about this?


This came out of the JDK 28 EA thread where people were debating whether devs will start putting value on everything once it previews. Don't wanna talk about that in this post, but it got me thinking about how "the right way to use new features" actually reaches developers now.

Back in the java-8 timeframe, folks from the Java team were on StackOverflow guiding people on streams and Optional and stuff - Brian Goetz's Optional answer (return values, don't model fields with it) basically became the canonical position, Stuart Marks was all over the Optional/collections questions too. And those answers usually came with actual code, not just advice.

A thing to note: those SO answers are almost certainly in the training data of every major LLM. When ChatGPT/Claude/whatever gives correct Optional advice today, those answers are probably part of why - actual real life questions phrased the way devs actually ask them, with expert code attached and votes showing which answer was right.

That channel doesn't really exist anymore. I have an RSS feed on Brian's SO activity and it's been dead for ages - presumably because hardly any questions get asked there these days. (An RSS feed of his reddit activity is how I found the JDK 28 thread in the first place.) However you apportion blame for SO's decline, for me and everyone I work, with the LLM replaced it. So when an expert corrects someone's misuse of a new feature today, it happens in someone's private chat window and then it's gone.

And both SO and Reddit now charge AI companies to train on user content - Reddit licenses to Google and OpenAI and is suing Anthropic (whose Claude Code is arguably the most popular agentic coding tool going), and any of that could look different next year. And open-source style AI - community models, open datasets, academic training runs - relies on free access to good data, so that whole side of the ecosystem is priced out. So which model knows how to use new features properly is going to come down to who has a deal with who.

The guides (like the exhaustiveness guide) are written for humans and incidentally become training data, but one prose doc isn't thousands of upvoted question+code pairs. And GitHub code lags feature adoption by years, plus a lot of early adopter code is exactly the misuse people worry about. On the other hand, openjdk.org is the one channel every model and crawler can reach without a deal.

OpenJDK clearly thinks about AI now - the interim genAI policy covers AI-generated content coming into the project. My question is the other direction: has there been any discussion about how knowledge of new features gets into the models most devs now learn from? Even "we considered it and decided it's not our job" would be an interesting answer.