r/java • • Aug 12 '21

There is no magic in Spring, I wrote my own (very simplified) framework from scratch to show it

211 Upvotes

Hi, I often hear that Spring is some kind of magic and there is no way to know how it works underneath. Probably many people know why annotations like @Transactional do not work in private methods and when called from the same bean. However, probably not everyone knows why this happens.

That is why I decided to write my own framework based on Spring from scratch. If you are a beginner I recommend you clone the repository, open a specific step as a package e.g. code - step 1, and read the readme at the same time with a description of the step.

If you are more advanced or you are only interested in the end result then everything is in step 7.

The framework includes dependency injection, @Transactional, and @Cacheable annotations.

The project: https://github.com/Patresss/Java-Own-Framework---step-by-step


r/java • • Nov 19 '21

I'm building a new personal finance manager. Thanks, Java, thanks for being excellent at date formats

Post image
210 Upvotes

r/java • • Feb 15 '22

IntelliJ Plugin that generates Javadocs using AI

209 Upvotes

r/java • • Jan 09 '26

Annote: A Turing complete language using only Java annotations as its syntax.

208 Upvotes

A while back I had a crazy idea, what if we could write Java, using only annotations. So I decided to build a full interpreter for an annotation only language in Java. It sounds crazy but it actually works.

GitHub: https://github.com/kusoroadeolu/annote

Definitely don't use this in production lol. Feel free to let me know what you think about this!


r/java • • Jan 29 '24

The One Billion Row Challenge Shows That Java Can Process a One Billion Rows File in Two Seconds

Thumbnail
infoq.com
207 Upvotes

r/java • • Dec 13 '21

How is a library like log4j even allowed to do random jndi calls outside the server secure environment?

207 Upvotes

It may be that I'm not fully understanding the nature of the exploit, but shouldn't there be other layers/rules preventing the arbitrary jndi calls?

What are legitimate scenarios where apps do jndi calls usually? Remotely loading code from unauthenticated sources seems to be the real issue.. log4j trying to do it seems minor in comparison..

what am I missing here?


r/java • • Sep 16 '19

The arrival of Java 13!

Thumbnail
blogs.oracle.com
207 Upvotes

r/java • • Sep 25 '18

Java 11 Released

Thumbnail
oracle.com
207 Upvotes

r/java • • 28d ago

Using Java skills for something a little different

Post image
205 Upvotes

Java is quite a handy language. Though it's challenging to use it for more fun projects. Towards that end, I set myself a challenge to use Java to build a browser-based game. No server, no API, just pure Web Assembly driven game play. Yes, there's some JavaScript glue, because, well, you gotta, but, the core logic is all Java. Along the way I learned that streams allocate a lot of objects, so I switched back to good old for loops... And watched the GC usage drop a fair bit. What I really do enjoy is how Java has evolved and changed over the years, and it makes it a lot simpler to do things like this. Records save me a ton of boilerplate code. Playable at https://nofuss.co.za/games/wartech/, but it's a bit meh on mobile, I'm still working on that. My focus right now is desktop play, and getting sound to work. Flame me in the comments with bug reports, I know there's a few... Hundred.

UPDATE: As promised, it's now open-source at https://github.com/ewaldhorn/wartech


r/java • • Dec 26 '25

Which lesser known libraries saved your butt this year?

205 Upvotes

It's holiday time, the sub is pretty dead, so let's stir the pot a little bit.

Most of this sub is probably well acquanted with likes of AssertJ, Guava, Vavr, Jackson, or JSpecify - we use them, we love them, but the ecosystem has more to offer.

Post lesser known Java libraries or tools that you rave about, are interesting, useful, or have saved your butt this year. Self promotion within reason is okay


r/java • • Mar 18 '25

Why most of the industry is still on Java 8?

205 Upvotes

With Java 24 on the corner, most of the larger organizations still use Java 8. Does it not make sense to upgrade java versions and give new features some rest. This would also solve many security issues.


r/java • • Mar 01 '22

Interview with Senior Java Developer

Thumbnail
youtube.com
205 Upvotes

r/java • • Apr 30 '20

How much memory was wasted when an additional boolean field was added to java.lang.String in Java 13? None at all.

Thumbnail
javaspecialists.eu
205 Upvotes

r/java • • Dec 03 '22

JDK 19, Virtual Thread-specific bugs (2nd edition)

204 Upvotes

Last month I shared my experience with JDK 19 and virtual threads: https://www.reddit.com/r/java/comments/yjtwhc/virtual_threads_work_great_until_something_goes/

I am following up with an updated list of bugs that I ran across so you know what landmines to watch out for:

  • Memory leak on Thread death: https://bugs.openjdk.org/browse/JDK-8296463

    • JDK 19.0.0 leaks native memory every time a Thread dies. If your application creates many short-lived threads the JDK will hang for no apparent reason. This one will mislead a lot of people because thread dumps don't contain any explanation for the hang.

    • This is bug is fixed in JDK 20 and 19.0.2.

  • Memory leak if short-lived Threads are created too quickly: https://bugs.openjdk.org/browse/JDK-8297168

    • The mechanism responsible for deallocating Thread memory could fall behind if you destroyed threads faster than it could handle. The new implementation should reduce the chance of this happening.

    • This bug is fixed in JDK 20 (no indication of a backport).

  • Memory leak when debugging an application: https://bugs.openjdk.org/browse/JDK-8297638

  • VisualVM hangs if applications create many short-lived Threads: https://github.com/oracle/visualvm/issues/461

    • Please help me convince the committers to fix this bug. They don't seem to understand why the existing behavior is a problem. Please vote and comment accordingly.

  • Deadlock when using Virtual Threads with Logback: https://jira.qos.ch/browse/LOGBACK-1711

    • This is a new bug report, so I have not received any response yet.

UPDATE: Added VisualVM bug to the list.


Does your team need help? I offer consulting services through https://www.linkedin.com/in/gilitzabari


r/java • • May 14 '21

Certificate Ripper released - tool to extract server certificates

204 Upvotes

r/java • • Jan 16 '20

Records Come to Java

Thumbnail
blogs.oracle.com
204 Upvotes

r/java • • Sep 06 '17

JavaEE is now on GitHub

Thumbnail
github.com
203 Upvotes

r/java • • Oct 27 '25

SpaceMonger in Java

Post image
202 Upvotes

Recently I found out SpaceMonger - one of the best disk space utilities out there (despite being created 25 years ago) has gone open source. So I took my time to port it to Java.

From user side. Yep, works on Linux. Yep, works on MacOS. Yep, still works on Windows however much more bloated than original 217K EXE. However, now it correctly handles all the filesystem stuff - links, sparse/compressed files, mount points (Windows and Linux only, I have no MacOS machine to test so MacOS is best-effort).

From technical side. Good old Swing, FFM API for native calls to precisely query filesystem metadata, Java is kind of limited there. Jlink for awesome 30Mb downloads. Unfortunately, native-image binary crashes miserably on Linux. jpackage launcher is unstable too - i've seen successful launches, JVM crashes and even double free errors.

Source code and downloads: https://github.com/scf37/spacemonger1/


r/java • • Dec 10 '22

Java Usage Keeps Climbing, According to New Survey

Thumbnail
thenewstack.io
202 Upvotes

Java may not be the most cloud-friendly of languages, but that hasn’t slowed down its usage, according to results from SlashData’s “State of the Developer Nation” report for the third quarter of 2022.


r/java • • Apr 20 '22

Java 15 introduced a cryptographic vulnerability

Thumbnail
neilmadden.blog
202 Upvotes

r/java • • Apr 13 '21

Libraries, Frameworks and Technologies you would NOT recommend

202 Upvotes

Give me your worst nightmares: Things that cost you your job.

I'll start: Hadoop


r/java • • Nov 26 '16

/r/Java is trending today!

Thumbnail
redd.it
202 Upvotes

r/java • • May 24 '25

Java Turns 30

201 Upvotes

Happy birthday Java! Java turns 30! Casual conversation: what's the first solution you ever built with java and what's the best of them?

My first was a timetable solution for my school, I wanted to solve the problem around double bookings and collisions.

Best solution, a payment platform service requests from around Africa.


r/java • • Sep 10 '21

Why people don't love Java?

201 Upvotes

I came across this post in r/cscareerquestions it seems majority of the people don't love to work with Java.

Is there any specific reason for that?

Edit: Thank you guys for your responses, I can't reply to all of the comments because I'm a beginner myself and I don't know what to reply for all your comments.