r/java • u/Party_Till_I_Die • May 28 '26
Gradle is Javamaxxing
blog.gradle.orgWhy the Gradle Build Tool aggressively chases the newest JDK.
r/java • u/Party_Till_I_Die • May 28 '26
Why the Gradle Build Tool aggressively chases the newest JDK.
r/java • u/Bobby_Bonsaimind • May 27 '26
r/java • u/jaccomoc • May 27 '26
Jactl is a secure, embeddable, scripting language for Java applications. Release 2.8 adds a new for-in statement and major compilation speed improvements.
The new for loop looks like:
for (pattern in collection) { ... }
This matches a structural pattern with variable binding against elements of a collection and iterates over all matched elements.
An alternative version uses strict matching and will fail if any element does not match:
for (pattern: collection) { ... }
Some examples:
for (i in collection) {} // match all elements and bind each one to i
for (int i in collection) {} // match all ints and bind to i
for ([i,j] in collection) {} // bind i,j to each 2-element sublist in collection
for ([i,_] in collection) {} // bind i to first element of each 2-element sublist
for ([i,i] in collection) {} // match all 2-element sublists with identical elements
for ([x,*] in collection) {} // bind x to head of all sublists of size >= 1
for ([h,*t] in collection) {} // bind h to head and t to remaining elements of each sublist
// More complex structures can be used:
for ([a, [_, int b, a]] in collection) {}
Patterns can also match Map instances and class instances. See Jactl 2.8.0 release notes for more details.
Compilation speed is the other big improvement in this release. Compilation speed is now over three times faster than the previous release (based on the Jactl Compilation Benchmark):

r/java • u/dibiduba • May 26 '26
r/java • u/Fenrurrr • May 24 '26
I've been reading up on Project Valhalla and the null-restricted types work. As I understand it, the proposed syntax is:
Point! p; // cannot be null
Point? p; // explicitly nullable
Point p; // unspecified (legacy default)My question: instead of forcing me to sprinkle ! on basically every field and parameter, why couldn't we declare a directive at the top of a file (or package) that flips the default? Something conceptually like:
// hypothetical: this whole file is non-null by default
non-null;
class Cursor {
Point position; // implicitly non-null
Point? lastHover; // opt back IN to nullable with ?
}So:
! by default, and you write ? for the rare nullable cases.! explicitly when you want non-null.In most codebases non-null is overwhelmingly the common case, so this would massively cut the noise. More broadly, I'd love to see Java adopt the modern-language mindset here: non-null by default, with nullable being the explicit exception you opt into (the way Kotlin, Swift, Rust… do it). That feels like the healthy direction for the language.
And I get that this is exactly where the hard part is: backward compatibility. That's precisely why I'm proposing an opt-in directive at the file/package level rather than changing the language's global default. If Java suddenly decided that a bare Point means "non-null," that would be a semantic change across billions of existing lines — code that compiles and runs today could start breaking. That's the very reason the current proposal keeps bare Foo as "unspecified": to not break existing code. An explicit directive, on the other hand, would only apply to the files/packages that declare it — so zero impact on old code, and gradual file-by-file migration. This is basically the spirit of JSpecify's @NullMarked (set at the package level via package-info.java), except it'd be carried by the language and compiler rather than a third-party annotation.
For what it's worth, the Valhalla team has explicitly said a class/module-wide marker "may be added later" but it isn't in the current draft — for now each type use is annotated individually.
So my actual questions for the sub:
!/? hurt readability ("is this Point non-null because of the directive, or because I forgot?")?@NullMarked + JSpecify as the de-facto answer until the language catches up?Curious how others see the tradeoff between "explicit everywhere" vs "sane default + opt-out."
r/java • u/moxyte • May 23 '26
r/java • u/rodolfo-mendes • May 23 '26
r/java • u/ihatebeinganonymous • May 21 '26
r/java • u/milchshakee • May 21 '26
r/java • u/asm0dey • May 21 '26
I tried to pick the most important parts of Quarkus that one might find useful to know before trying it
r/java • u/johnwaterwood • May 21 '26
r/java • u/CutGroundbreaking305 • May 20 '26
And here I am, made a Java-based numerical library called JNum.
I used the new FFM API and Vector API (Project Panama) to make it 100% pure Java, unlike ND4J which relies heavily on JNI and massive C++ backends. Here is the repo: https://github.com/CH-Abhinav/JNum . It is currently in a v0.1 (PREVIEW).
Some of you may ask: Isn't the Vector API still in incubator? Yeah, even though it's still in incubation I preferred to continue building with it as it doesn't have any major API changes planned except the inclusion of value classes (hopium it is coming in Java 27 🙃).
The Performance so far: By avoiding the JNI crossover latency, the basic math tasks (add, mul) are actually faster compared to ND4J and NumPy on small/medium arrays.
The main wins are the reduction methods (sum, max, min) which are about 2x faster compared to ND4J.
Because there is no native C++ backend, the entire library is under 100KB, compared to the hundreds of megabytes required to bundle native binaries.
The Matmul Struggle: Obviously, the main talking point for tensor engines is matmul. Not gonna lie, this ate my brain while trying to figure out which memory settings and SIMD loops work best. Right now, a 1024x1024 float matrix multiplication takes about ~51ms. It's fast, but we still haven't reached the massive performance of ND4J or NumPy on huge matrices (I haven't implemented multi-threading or L1/L2 cache tiling yet).
Use case (potential): ND4J is bulky, and when making applications (web or Android) which require some sort of math and performance, Java devs need to bundle that bulky dependency. We can run JNum anywhere as it doesn't have any .dll or .so files, nor JNI—just pure Java.
I guess this project will become more like multik but better and javaish. And I'm expecting ML guys in Java can also use it (though ND4J/DJL is better for now).
I want the Java community to help me build this project! I am still learning the deeper JVM optimizations(stylish way of saying i am newbie), so if anyone has experience with SIMD loop unrolling, cache tiling or anything helpful I'd love some code reviews, advice, or PRs and help this fellow java guy.
r/java • u/goto-con • May 21 '26
r/java • u/HesandaLiyanage • May 20 '26
Hey everyone,
I just built my first ever Java library and wanted to share it.
It’s a small Spring Boot security SDK called Vault SDK. The basic idea is that you can add it to another Spring Boot project as a dependency, configure it, and it handles the auth filter/client/security context side of things.
It’s still super early, like 0.0.x early, so I’m sure there are rough edges. Since it touches security-related stuff, there might be things I’ve missed or designed badly, and I’d really appreciate feedback from people who know Spring/Spring Security better than me.
GitHub: https://github.com/HesandaLiyanage/theVaultOfficial
It’s open source, and contributions/issues/roasts are welcome.
r/java • u/AlyxVeldin • May 20 '26
r/java • u/daviddel • May 20 '26
r/java • u/Nerdy-coder • May 20 '26
So as a devops engineer on my company. I have tried using eclipse-temurin:17-jre-jammy and eclipse-temurin:17-jre java versions as base image for dockerfile but as i scanned the built image using trivy i found tons of vul nerabilities ob both. So what are the other alternatives for me ?
r/java • u/elacin • May 19 '26
Ever dreamt of creating stunning TUIs in java? well here is your chance!
There are three layers to this:
Graalvm native-image compatible, crossterm-wrapper is currently implemented with JNI.
r/java • u/Junior_Plankton_635 • May 19 '26
Hello fellow Java Enthusiasts. Anyone have info on the Montana Mini Computer? I discovered it from a "Molly Rocket" (one of Casey Muratori's YT channels) video recently.
I note that u/thewiirocks discussed it a bit back 9 months ago in this sub.
But messing with it now, it appears the emulated "files" for the various source documents are all broken, and the GIT repository is now read only.
TYIA!
EDIT: I see I messed up, I thought the emulator was online, it is not. One has to download it and ensure they have a JVM.
r/java • u/tanin47 • May 19 '26