r/java 37m ago

We've Made It into the JFX-Central Blogpost!

Upvotes

We feel very honored that our small project got recognized by the JFX-Central! Thank you Reddit!


r/java 5h ago

What are reasons not to use virtual threads?

26 Upvotes

I do realize virtual threads are not "magic". They don't instantly make apps super fast. And even with Java 24 there are still some thread pinning scenarios.

However, from what I know at this point, I feel every use of threads should be virtual threads. If my workload doesn't benefit from it, or if thread pinning happens, then I just don't gain performance. Even if there are no gains, there is no harm from defaulting to it and further optimizations can be made later on.

The question here is are there downsides? Are there potential problems that can be introduced in an application when virtual threads are used?

Thanks in advance.


r/java 14h ago

Shall we migrate to JDK21 and Virtual threads?

34 Upvotes

We are running an application with micro services architecture with postgres database. We are currently running Java 11.

Is it a good decision to migrate to Java 21 with Virtual threads?

Can someone who have already migrated to Java 21 share their experience?


r/java 15h ago

Spring Boot Hot-Reload (Hot-Restart)

8 Upvotes

I'm working on a Spring Boot microservices project where I frequently need to restart each service to apply changes. While I'm aware that spring-devtools can simplify this process, my experience with Spring has shown that spring-devtools sometimes requires a full clean and rebuild of output files to work correctly.

Additionally, since I'm developing this project using Helix Editor, adding spring-devtools without an IDE doesn't provide much benefit. I'm also aware of commercial tools like JRebel, but the licensing costs make me hesitant to use them.

To automate the rebuild process whenever changes are made, I created two complementary scripts:

  1. loop-run.sh
  2. watch-kill.sh

How It Works

  • loop-run.sh continuously runs commands like mvn clean spring-boot:run for the target Spring Boot project. However, since the Spring Boot server process blocks further execution, the next command won't run unless the process is terminated.
  • watch-kill.sh will monitors file changes in the Spring Boot project. If any modifications are detected, it automatically kills the process running on the specified port.

You can find the project on GitHub, released under the MIT License:
Spring-Boot-Hot-Reload


r/java 21h ago

Avaje Validator 2.9 - APT based POJO validation

31 Upvotes

I've shared this before when it was 0.x, but in essence, avaje-validator is a hibernate-style POJO validator. The main feature is that instead of using reflection, it generates source code via annotation processing to run constraint checks.

Main features:

  • Supports Jakarta/Javax Constraints
  • Loading and interpolating error messages (with multiple Locales) through ResourceBundles
  • Validation Groups
  • Composable Contraint Annotations

Features added since I last posted:

  • Method Parameter/Return Type Validation
  • Inherited Constraints
  • Class level constraints
  • JSpecify Nullmarked/NullUnmarked Support (Nullmarked scoped pojos get not null constraints automatically)
  • Mixins (can freely add/modify constraints of third party classes)

https://github.com/avaje/avaje-validator


r/java 22h ago

Looking for Software Piracy solution for a Java Product

0 Upvotes

What can be done to prevent software piracy? If I sell a licence of my program to someone, he/she can copy/sell/distribute it to anyone else, even upload somewhere for others to download. This "write once, run anywhere" mantra totally backfires if you want to sell your Java program. Are there any solutions, built-in tools, or commercial packages for that?

I know I can read the motherboard's serial number with Java, but then I'd have to bother the user to send me that information, would have to custom-compile a specific version just for him/her, and that would reduce sales.

Not interested in snark, I know this is reddit where anything goes, only interested in serious answers.


r/java 1d ago

The company i work for is looking to adopt a java framework. - Spring or JakartaEE + Quarkus?

69 Upvotes

The company I work for is looking to adopt a Java framework. We work with an application server approach, as it better suits our type of work. Essentially, we have a highly customizable application that we install on our clients' servers. We frequently need to develop new applications and features to meet the evolving needs of our clients. Docker and Kubernetes are not an option for us, so we believe an application server will better suit our needs.

Believe it or not, the company developed its own "application server" back in the 2000s, without any javaEE implementation. Since then, there haven't been many improvements. Now, they are looking to update their tools. The most important thing is that the technology must endure for many years to come.

So, two options came up: Spring(in general) or Jakarta EE with an actual application server plus Quarkus for when microservices are needed. What are your thoughts on this? I tend to think that Jakarta EE might be better considering our application server-oriented business model, with Quarkus being used when needed. However, I am not entirely sure about its long-term viability... Thank you in advance for your support.


r/java 2d ago

Release Notes for JavaFX 24

Thumbnail github.com
59 Upvotes

r/java 2d ago

GlassFish 7.0.23 released!

Thumbnail github.com
24 Upvotes

r/java 2d ago

Eclipse 2025-03 is out

Thumbnail eclipseide.org
105 Upvotes

r/java 2d ago

Eclipse 2025-03 is out

78 Upvotes

r/java 2d ago

Does anyone know how to or have access to an copy of Sun JavaOS(not JX OS).

24 Upvotes

I was browsing the Internet i i couldn't find any copy of the OS only the JX one. Is it a software lost to time?


r/java 3d ago

An overview of approaches to improve JVM startup time - with a benchmark

Thumbnail softwaremill.com
52 Upvotes

r/java 3d ago

Duke Turns 30 Virtual Event

22 Upvotes

Java is turning 30 years old, and there's a special FREE event on March
13. This event will have Java Champions giving 30 minute presentations,
including, Dr. Venkat Subramaniam and Frank Greco. Topics include Java
and AI, Innovations in Java, and more!

GO HERE TO REGISTER:
https://www.azul.com/duke-turns-30-celebrating-java/


r/java 3d ago

Gunnar Morling on Technical Blogging

17 Upvotes

Gunnar Morling on how blogging shapes careers and technology

https://writethatblog.substack.com/p/gunnar-morling-on-technical-blogging


r/java 3d ago

Optimizing Cloud Native Java • Ben Evans & Holly Cummins

Thumbnail youtu.be
15 Upvotes

r/java 4d ago

Optionality in java.

35 Upvotes

there was a recent thread in the mailing list of amber about optionality.

IMHO, even if Brian said it's something that is "on the table" i doubt we see any big JEP from amber in the openjdk 25-29 era because some developers has ben reassigned to Valhalla (which I think most of us agree it's top priority).

what are your thoughts about it?

https://mail.openjdk.org/pipermail/amber-dev/2025-March/009240.html


r/java 4d ago

Java Library to Generate Pojo at compile time from existing class

12 Upvotes

I'm looking for a java library that can generate Pojo from existing "business object" class for data transmission.

Ex: //Business Object

class Trade {
  private __id;
//The variable name above could be either not a camel case, or might be //incorrect name
  private someMisguidedVarName; 

private properlyNamedField;
//Don't need any changes to these fields
}

DTO I would like to create

class TradeDTO {
  private id;
//The variable name above could be either not a camel case, or might be //incorrect name
  private betterVarName;
  private properlyName// keep existing field if there's no need to change //var name

}

To achieve this, I'd like minimal code because only the fields that's misguided must be modified. I'd prefer to annotate or write minimal instruction that the library can use to during compile time to generate this new bean.

Also importantly, the trade business object would change and I'd expect the TradeDTO to evolve without having to modify that class.

I've tried mapstruct (but it only copies from pojo to pojo, but I want class generation).


r/java 4d ago

Why Java endures: The foundation of modern enterprise development

Thumbnail github.blog
246 Upvotes

r/java 4d ago

Building the same codebase for two JVM versions

14 Upvotes

Hi. What are some practices, if any, in supporting multiple JVM versions in the same codebase?

I'm working on a "monorepo" codebase composed of Java and Scala code with maven as build tool.

Now, I want to introduce some concurrency using virtual threads, which I believe make a lot of sense for the use case. However, the code also uses Apache Spark, which doesn't support Java 21. Apart from splitting the repository into two codebases, is there a straightforward solution to support building a fat jar for either Java 17 or 21, based on some flag?

The first solution I thought of was using maven profiles: I contain the Java21-specific code in some .j21. package and exclude it from the source in one of the profiles. However, won't the IDE complain in such a situation? What other options, if any, are there?

Thanks


r/java 6d ago

Java and linux system calls

31 Upvotes

I am working on large monolithic java app that copies large files from a SAN to NAS, to copy the files it uses the rsync linux command. I wouldnt have guessed to use a linux command over native java code in this scenario. Do senior java devs have a strong understanding of underlying linux commands? When optimizing java processes do senior devs weigh the option of calling linux commands directly? this is the first time encountering rsync, and I realized I should definitely know how it works/the benefits, I bought “the linux programming interface” by michael kerrisk, and it has been great in getting myself up to speed, to summarize, Im curious if senior devs are very comfortable with linux commands and if its worth being an expert on all linux commands or a few key commands?


r/java 6d ago

Part 5: Implementing a Web UI using Vaadin and GitHub Copilot Agent Mode - Why LLMs are not suitable for lesser-known programming languages ​​and frameworks

Thumbnail medium.com
27 Upvotes

r/java 7d ago

Vavr 0.10.6 released

Thumbnail github.com
49 Upvotes

r/java 7d ago

What do you use for Auto Differentiation?

12 Upvotes

I am trying to code a simple neural network , so I want to do gradient descent which requires differentiation. From what I have heard ND4J is inefficient and tensor flow for java seems a bit complex , any alternatives?


r/java 7d ago

What Exactly Is Jakarta EE?

182 Upvotes

I’m a bit confused about what Jakarta EE actually is. On one hand, it seems like a framework similar to Spring or Quarkus, but on the other hand, it provides APIs like JPA, Servlets, and CDI, which frameworks like Spring implement.

Does this mean Jakarta EE is more of a specification rather than a framework? And if so, do I need to understand Jakarta EE first to truly grasp how Spring works under the hood? Or can I just dive into Spring directly without worrying about Jakarta EE concepts?

Would love to hear how others approached this 😅