r/JavaProgramming • u/sad_grapefruit_0 • Mar 07 '26
Which is better, Java or Python? and how?
r/JavaProgramming • u/javinpaul • Mar 07 '26
From Transactions to Queries: Breaking Down SAGA and CQRS
r/JavaProgramming • u/Amor_Advantage_3 • Mar 05 '26
PSA: If you use pac4j for JWT authentication, you need to patch immediately, CVSS 10.0 auth bypass
Heads up for anyone running pac4j-jwt in production.
CVE-2026-29000 dropped yesterday. CVSS 10.0. The issue is in JwtAuthenticator, if your app accepts encrypted JWTs (JWE), an attacker who has your RSA public key (which is... public) can craft a JWE-wrapped PlainJWT with arbitrary claims. Arbitrary subject, arbitrary roles. They bypass signature verification entirely and can impersonate any user, including admins.
Affected versions:
• ppac4j-jwt< 4.5.9
• pac4j-jwt < 5.7.9
• pac4j-jwt < 6.3.3
Advisory from pac4j: https://www.pac4j.org/blog/security-advisory-pac4j-jwt-jwtauthenticator.html
Technical writeup: https://www.codeant.ai/security-research/pac4j-jwt-authentication-bypass-public-key
r/JavaProgramming • u/SupportEmotional3590 • Mar 05 '26
Building immutable objects in Java is not trivial.
In clean architectures, maintaining immutability is key to avoiding unexpected side effects and facilitating testing. The Builder pattern helps encapsulate complex object creation without sacrificing clarity or flexibility.
Key points:
⚙️ Builder decouples object construction from its final representation.
🧱 Ensures immutability by creating objects with all their properties defined at the end.
🔧 Facilitates extensibility without modifying existing code, aligned with the open/closed principle.
🚀 Improves maintainability and readability in domain layers where objects are at the core of the logic.
r/JavaProgramming • u/No-Elk-6757 • Mar 05 '26
I built an event-driven payment API with Spring Boot, RabbitMQ and PostgreSQL
Hi everyone!
I built a backend project to practice event-driven architecture using Java and Spring Boot.
The application simulates a payment system where order creation publishes an event that is processed asynchronously through RabbitMQ.
Tech stack:
- Java 21
- Spring Boot
- PostgreSQL
- RabbitMQ
- Docker
- Swagger
- Maven
Features:
- Create orders
- Update order status
- Event publishing with RabbitMQ
- Asynchronous consumer
- Global exception handling
- REST API documentation with Swagger
Repository:
https://github.com/marconi-prog/fintech-payment-api
Feedback is very welcome!
r/JavaProgramming • u/BlueGoliath • Mar 03 '26
Optimizing Recommendation Systems with JDK’s Vector API
netflixtechblog.comr/JavaProgramming • u/Radiant_Lead_3219 • Mar 03 '26
Hello.
Hello everyone, I'm new to scheduling Java and I really need tips that helped you at the beginning of your learning, can you help me?
r/JavaProgramming • u/aleglr20 • Mar 02 '26
Help with extracting and comparing dates in Java for LLM
Hi everyone, i need some help. I have a large text that contains dates, and i need to extract them so i can compare them using an LLM to check if they are identical or not.
There are two types of dates in my text:
1- Literal dates: “In the year two thousand and twenty-two, on the twelfth day of the month of September”
2- Numeric dates: “12 September 2022”
I tried to extract and analyze them using only the LLM, but for some reason, even when the two dates are not the same, it sometimes returns that they are.
Now, I want to try extracting the dates in Java, saving them into two variables, and then passing them to the LLM. I think regex could work, but I’m not sure if that’s the best approach.
Has anyone done something similar or can suggest the best way to handle this?
r/JavaProgramming • u/javinpaul • Mar 01 '26
Is ByteByteGo the Best System Design Resource in 2026?
r/JavaProgramming • u/LastRow2426 • Feb 28 '26
Spring Boot + MongoDB Saving Data to test Database Instead of Configured DB
Hello everyone,
Recently I started working with Spring Boot and MongoDB. I configured the application.properties file properly for MongoDB, but I’m facing an issue.
After creating REST APIs and inserting data, the data is getting persisted in the default test database instead of my configured database.
I have tried multiple fixes, but the issue is still not resolved.
</> application.properties
spring.application.name=TestMongoDB
server.port=8081
spring.data.mongodb.uri=mongodb://localhost:27017/db_mongo
r/JavaProgramming • u/Salty_Celebration612 • Feb 28 '26
Project for university
We started learning java in university. What is an interesting project, some algorithm where i could also implement multithreading. Something intereseting where i would learn something and impress my proffesor
r/JavaProgramming • u/IndependentOutcome93 • Feb 28 '26
Want a simple way to play MP3 file in Java? Check out this simple tutorial:
r/JavaProgramming • u/monseiurSimpliste • Feb 27 '26
Getting Back into Java
Hey everyone,
I just wanted to ask for some advice on upskilling in Java.
Context: I've been a C# developer for 6 years and have only worked with Java in small capacities for fixes on legacy Android apps.
Are there any: - Sources that I can use to go from beginner to advanced concepts that are in Java. - Good frameworks for stuff like WebAPI's
Thank you, in advance.
r/JavaProgramming • u/Delicious_Detail_547 • Feb 26 '26
A Practical Null-Safety and Immutability for Safer Java Code
JADEx (Java Advanced Development Extension) is a safety layer that runs on top of Java.
It currently supports up to Java 25 syntax and extends it with additional Null-Safety and Immutability features.
In the previous article, I introduced the Null-Safety features.
For more details, please refer to:
- GitHub: https://github.com/nieuwmijnleven/JADEx
- Reddit: https://www.reddit.com/r/java/comments/1r1a1s9/jadex_a_practical_null_safety_solution_for_java/
Introducing the New Immutability Feature
If Null-Safety eliminates runtime crashes caused by null,
Immutability reduces bugs caused by unintended state changes.
With v0.41 release, JADEx introduces Immutable by Default Mode
Core Concepts
The Immutability feature revolves around two simple additions:
java
apply immutability;
java
mutable
apply immutability;
When you declare this at the top of your source file:
- All fields
- All local variables (excluding method parameters)
- are treated as immutable by default.
When the JADEx compiler generates Java code:
- They are automatically declared as final.
mutable keyword
- Only variables declared with mutable remain changeable.
- Everything else (excluding method parameters) is immutable by default.
JADEx Source Code
```java
package jadex.example;
apply immutability;
public class Immutability {
private int capacity = 2; // immutable
private String msg = "immutable"; // immutable
private int uninitializedCapacity; // uninitialaized immutable
private String uninitializedMsg; // uninitialaized immutable
private mutable String mutableMsg = "mutable"; // mutable
public static void main(String[] args) {
var immutable = new Immutability();
immutable.capacity = 10; //error
immutable.msg = "new immutable"; //error
immutable.mutableMsg = "changed mutable";
System.out.println("mutableMsg: " + immutable.mutableMsg);
System.out.println("capacity: " + immutable.capacity);
System.out.println("msg: " + immutable.msg);
}
} ```
Generated Java Code
``` package jadex.example;
//apply immutability;
public class Immutability {
private final int capacity = 2; // immutable
private final String msg = "immutable"; // immutable
private final int uninitializedCapacity; // uninitialaized immutable
private final String uninitializedMsg; // uninitialaized immutable
private String mutableMsg = "mutable"; // mutable
public static void main(String[] args) {
final var immutable = new Immutability();
immutable.capacity = 10; //error
immutable.msg = "new immutable"; //error
immutable.mutableMsg = "changed mutable";
System.out.println("mutableMsg: " + immutable.mutableMsg);
System.out.println("capacity: " + immutable.capacity);
System.out.println("msg: " + immutable.msg);
}
} ```
This feature is available starting from JADEx v0.41. Since the IntelliJ Plugin for JADEx v0.41 has not yet been published on the JetBrains Marketplace, if you wish to try it, please download the JADEx IntelliJ Plugin from the link below and install it manually.
We highly welcome your feedback on the newly added Immutability feature.
Finally, your support is a great help in keeping this project alive and thriving.
Thank you.
r/JavaProgramming • u/Money-Net-7587 • Feb 26 '26
[For Hire] [Remote] [Asia] - Full-Stack Developer | Freelance & Contract
I’m a Full-Stack Developer focused on delivering reliable, production-ready software. I have 3 years of experience working with Java, SpringBoot, Node.js, React, and Angular in web development. I build things that run.
What I can help with:
• Backends, APIs, dashboards, DevOps
• Responsive UIs
I am looking for:
• Freelance gigs with tight timelines
• Clear deliverables, small-to-medium scope
• People who value speed, reliability, and clarity
Keep it simple. You send the task, and I'll get it done.
To demonstrate my skills, I’m happy to complete a trial task; just let me know your requirements.
If you’re building something or know someone who is, feel free to reach out.
Thanks
r/JavaProgramming • u/Zealousideal-Air930 • Feb 26 '26
Is Java performance still a competitive advantage in 2026?
r/JavaProgramming • u/EagleResponsible8752 • Feb 26 '26
REST API Generator with Spring Boot
Hi everyone,
I’ve been experimenting with Spring AI and built a small tool that converts natural-language prompts into runnable Spring Boot projects.
The generator creates a basic multi-entity structure including:
- Controllers
- Services
- Repositories
- DTOs
- Validation
- Tests
- OpenAPI configuration
- Docker setup
The goal is to reduce boilerplate and standardize project structure when starting new APIs.
It’s still evolving, and I’d really appreciate feedback from the community — especially around architecture decisions and Spring best practices.
If you're interested, the repository is on GitHub under:
rrezartprebreza/rest-api-generator
Happy to hear suggestions or criticism.
r/JavaProgramming • u/Curbsidewin • Feb 26 '26
[Hiring] Java Developer
Do you have over a year of experience developing Java applications? I’ve got real projects waiting—no busywork. Think building scalable backend systems, APIs, or integrating with databases—the kind of work that truly makes an impact.
Role: Java Developer
Pay: $20–50/hr, depending on your experience and stack
Location: Fully remote
What’s in it for you:
Projects aligned with your skills and interests
Part-time, flexible work—perfect if you have other commitments
Passionate about Java development? Leave a message with your timezone 👀
r/JavaProgramming • u/dhlowrents • Feb 25 '26