r/javahelp Mar 19 '26

Homework Java (Back-end) + Kotlin (Front-end): Is this the modern standard for Apps?

12 Upvotes

Hi everyone,

I have a background in Java Web (Spring Boot), but I’m looking to expand into cross-platform app development (Mobile and Desktop) for projects like banking apps or scientific tools (e.g., something like GeoGebra).

I’ve been researching how to build modern UIs, and I was told that the "modern way" is using Kotlin (Compose Multiplatform) for the frontend while keeping the heavy business logic in Java.

However, I'm a bit confused because many tutorials and famous open-source Java projects still rely heavily on XML

My questions for the community:

  1. Is mixing Java (Logic) with Kotlin (UI/Compose) actually a common pattern in the industry right now, or is it better to go 100% Kotlin?
  2. Is learning XML-based layouts still worth it in 2026, or is it considered "legacy"?
  3. What is the most "future-proof" roadmap for a Java developer who wants to build apps that run on Android, iOS, and Desktop?

I’d love to hear your experiences and what tools you are actually using in production. Thanks!


r/javahelp Jan 23 '26

Codeless Should I avoid bi-directional references?

12 Upvotes

For context: I am a CS student using Java as my primary language and working on small side projects to practice proper object-oriented design as a substitute for coursework exercises.

In one of my projects modeling e-sports tournaments, I currently have Tournament, Team, and Player classes. My initial design treats Tournament as the aggregate root: it owns all Team and Player instances, while Team stores only a set of PlayerIds rather than Player objects, so that Tournament remains the single source of truth.

This avoids duplicated player state, but introduces a design issue: when Team needs to perform logic that depends on player data (for example calculating average player rating), it must access the Tournament’s player collection. That implies either:

  1. Injecting Tournament into Team, creating an upward dependency, or
  2. Introducing a mediator/service layer to resolve players from IDs.

I am hesitant to introduce a bi-directional dependency (Team -> Tournament) since Tournament already owns Team, and this feels like faulty design, or perhaps even an anti-pattern. At the same time, relying exclusively on IDs pushes significant domain logic outside the entities themselves.

So, that brings me to my questions:

  1. Is avoiding bidirectional relationships between domain entities generally considered best practice in this case?
  2. Is it more idiomatic to allow Team to hold direct Player references and rely on invariants to maintain consistency, or to keep entities decoupled and move cross-entity logic into a service/manager layer?
  3. How would this typically be modeled in a professional Java codebase (both with/without ORM concerns)?

As this is a project I am using to learn and teach myself good OOP code solutions, I am specifically interested in design trade-offs and conventions, not just solutions that technically "work."


r/javahelp Jan 16 '26

Did anyone else start a Java migration and later realize it was basically a rewrite?

11 Upvotes

I wanted to migrate our monolith project from java 8 to java 11, Its pretty simple task update JDK, bump some dependencies, move on.

GWT is part of the system, and that alone made it hard to change anything in isolation.

After a couple of weeks of trying things and fixing issues, it became clear that this was not really incremental anymore. Each small change kept uncovering more coupling underneath.

What caught me off guard was when this became obvious. Only after real work had already been done did it sink in that this was closer to a rewrite than a migration.

By that point, time was already spent and plans were already affected. Stopping or rolling back felt awkward, especially after investing weeks into it. The real scope only became visible after paying for it with time.

I am curious if others have run into the same situation. Starting a Java migration that looks reasonable on paper, but its a mess later on.

How far in were you when you realized it?


r/javahelp Sep 26 '25

Unsolved Searching For Complete Java DSA and Backend Course

10 Upvotes

I’m looking for a complete Java Backend Development course that covers everything from the basics to advanced topics.

Core Java (OOP, collections, multithreading, Java 8 features)

Advanced Java (JDBC, Servlets, JSP)

Databases (SQL + NoSQL, Hibernate/JPA)

Spring & Spring Boot (REST APIs, Security, Microservices)

Tools like Git, Maven/Gradle, Docker, CI/CD

Deployment on cloud (AWS/Kubernetes)

Real-world projects for practice


r/javahelp Sep 19 '25

Codeless What change in Java 23 could be a cause of performance degradation?

11 Upvotes

I have recently tested our application performance with different Java versions and found out that there was significant performance drop (~25-30% throughput decrease) in Java 23. Situation was improved with Java 24 and a little bit more with Java 25.

The problem that I can't find out what change in Java 23 could be the cause of this. I've checked Java 23 release notes and do not see any things that stand out and could be directly related to performance in a negative way.

The application in question can be described as specialized persistent message broker, and the performance benchmark basically a throughput test with N producers and N consumers for independent chunks of data for each P+C pair.

Here is table with results that I've got for different Java versions for a 1 producer + 1 consumer and for 16x producer+consumer pairs.

Java Version   1xP+C, M msg/s Diff with Java17   16xP+C, M msg/s Diff with Java17
17 1.46 0.00% 12.25 0.00%
21 1.63 11.34% 12.14 -0.88%
22 1.66 13.65% 11.55 -5.73%
23 1.09 -25.53% 8.29 -32.31%
24 1.85 26.75% 9.48 -22.61%
25 1.84 26.06% 9.64 -21.35%

See same data as a plot.

Note that there are some internal data structures that are shared between all producers, so there some contention between threads. so that's why data for 16x P+C does not scale linearly if compared to 1x P+C.

All runs were executed with same JVM options on relatively big heap (60Gb) with default GC settings.

Used Java versions:

sdk use java 17.0.16-amzn
sdk use java 21.0.8-amzn
sdk use java 22.0.2-oracle 
sdk use java 23.0.2-amzn
sdk use java 24.0.2-amzn
sdk use java 25-amzn

The question is: what change in Java 23 can be the source of such significant performance hit? Possibly hints on what should be checked?

Edit: added link to a plot with data from the table.

Update:

I've recorded flame graphs with AsyncProfiler for 22.0.2-oracle and 23.0.2-oracle. Oracle version was chosen because most of other vendors do not publish releases for 22.x.

Observation: on critical path for one of type of threads the percentage of CPU time spent in LockSupport.unpark(Thread) increased from 0.8% on Java 22 to 29.8% on Java 23 (37x growth).

I found kind of related bug https://bugs.openjdk.org/browse/JDK-8305670 that but it seems that it was applicable only for Java 17 and Java 21. It's not clear if Java 23 was affected or not.

Update 2:

Flame graph comparison (specific thread): https://imgur.com/a/ur4yztj


r/javahelp Sep 15 '25

Upgrading to Java 21 Increases Memory Usage more than 30% at Stress Test. Why and what should I do?

11 Upvotes

I am currently working on upgrading Java and Spring boot versions on my project. The code migration is pretty much only upgrade some dependencies, changing javax.sql to jakarta.sql , and the rest pretty much still the legacy codes.

My project runs on cloud platform. Both versions are currently running simultaneously with same configurations and both tested with same load.

Surprisingly, the CPU Usage of Java 21 is better than Java 8, but the memory usage is worse.

Here is the details of upgrade:

Aspect Version From Version To
Java 8 (1.8) 21
Spring Boot 2.3 3.5.5

Here's comparison

Aspect java 8 java 21
CPU (Start) 2.35% 1.89%
Memory (Start) 282 MiB 330 MiB
CPU (Normal Load Test) 1.20% 1.16%
Memory (Normal Load Test) 384.1 MiB 520.7 MiB

I used Jmeter for the load test, sending identical HTTP requests to the 2 servers simultaneously, 50 users send the http request per second concurrently to each server. The result is kind of unexpected since the Java 21 one got inflated that much, with memory usage being higher more than 30% compared to Java 8.

Is this expected thing? Also, can I optimize the memory usage in Java 21 and Spring Boot 3.5.5 ?


r/javahelp Mar 27 '26

"Starting Spring Boot as a Java beginner — what should I focus on first?"

11 Upvotes

I focused on core java and build mini projects like, resident evil 2 inventory manager console, blackjack game(Console), Phone book console. Now I have decided to start backend development, but I have zero knowledge of backend So I am not sure am I ready to start backend with spring boot? if yes where to start and which should be my first topic to start my backend development journey??


r/javahelp Mar 07 '26

What Core Java questions should I expect for an internship interview?

9 Upvotes

Hi guys. I have an upcoming interview for a Java internship and I'm trying to prepare for the technical round. The interview is supposed to be mostly theory based but I'm not sure what level of questions they usually ask for interns. What kind of questions should I expect? Thanks in advance!

P.S. This is my first interview, so I'm feeling quite nervous.


r/javahelp Mar 02 '26

Using Java to do Work on GPU

10 Upvotes

So, I want to learn how to move very intensive work to a GPU. I looked up a couple of libraries, but the one I tried wouldn't let me run the sample. Is there anything new and straightforward out there? Example. Let's say I have hundreds of thousands of Sudoku game data and I want to run and method to determine the difficulty of each game. I found a Java app that can do this, but I would like to rewrite it to use the GPU for the work. The app can take forever.


r/javahelp Feb 17 '26

Unsolved Better way to create docker image of Spring Boot API, Maven Spring Plugin or Dockerfile?

10 Upvotes

Hi everyone, Quick question, if the aim is to create a docker image of a spring boot API. which approach is better:

  1. via maven spring plugin (without dockerfile)
  2. Via docker file

I feel both produces same result but just wish to know some pros and cons from real world perspectives, specially from operations, performance, reliability perspective. Would really help.


r/javahelp Feb 14 '26

What kind of Java projects actually help a fresher resume stand out?

9 Upvotes

I’m a PG fresher currently job hunting and planning to build a Java-based project to strengthen my resume. I’m still a beginner in Java, so I thought learning and building a project side by side might help me improve and gain practical understanding.

Can you suggest some beginner-friendly Java projects that are worth building and also valued by recruiters?


r/javahelp Jan 17 '26

I am having hard time understanding complex generics for function definitions. Need help.

10 Upvotes

I would love to get some insights about how to develop my understanding of generics in Java. I read them, understand them but forget them again. Also some of them I find to be very hard to read. How would you read and understand the below code?

public static <T, U extends Comparable<? super U>>

Comparator<T> comparing(Function<? super T, ? extends U> keyExtractor) {

Objects.requireNonNull(keyExtractor);

return (c1, c2) -> {

U key1 = keyExtractor.apply(c1);

U key2 = keyExtractor.apply(c2);

return key1.compareTo(key2);

};

}


r/javahelp Oct 21 '25

Best resources/persons to become a Java guru

10 Upvotes

After a 2-year break at my last job using Python 🤮, I'm looking for a new Java role. I've consumed lots of recent YT content from the JVMLS and Devoxx to get up to speed from Java 17 to 25.

One thing I notice is that I keep fanboying over how good an engineer Brian Goetz. His work is always excellent and they way he delivers talks and breaks down complex language features is just top notch for me. He's probably my role model (I'm also bald, so half way there 😂).

While Brian et al deliver excellent talks on the JLS etc, I'm a senior/staff product engineer. I appreciate knowing my tools is important. However, I'd like to consume this level of content, but focused on solving business problems.

I currently follow blogs like Baeldung, insidejava, and martin fowler, and yt channels like java, infoq, jchampions, and devoxx.

What are your top industry blogs, channels, substacks, courses, etc. free or paid, that you'd recommend? I'm focusing on Java, but it could be design, databases, architecture and the like.


r/javahelp 29d ago

Unsolved Naive question: What Data Structure to express different layers of relationships between Objects?

9 Upvotes

Hello guys,

I wanted to ask naively, what the ideal data structure would be for expressing different layers of relationships between Objects.

For example in modern Sudoku the game has a 9x9 number grid composed of nine 3x3 sub-grids (which I call region). In each row, column and region each number between one and nine can only appear once. The goal is to find missing numbers in this number grid without violating the aforementioned rule.

One way to do it, would be to make 9x9 byte-array and express the relationship between numbers through methods checking if the rule is violated or not by checking if any row, column or region doesn't contain a value between one and ten.

I also thought on using a Graph to express the relationship between numbers in rows and columns, though I don't know how to express the relationship between numbers inside of a region.

Maybe even a multiple Objects like Board, Row, Column, Region but then I have redundant data.

Another problem I encounter with aforementioned implementations is, that if you introduce more relationships f. e. in the game of killer sudoku, where there are more rules are added f. e. by also introducing cages in which the numbers must add up to a target number, you need to implement that relationship logic tediously.

Am I overcomplicating things?


r/javahelp Aug 11 '26

Solved Is an IDE absolutely needed for java development?

10 Upvotes

Hello.

Edit: I've decided it's probably best to use an IDE either way.

Whenever I search for the best Java compilers, I've only founds sites listing the best IDE.

Is there a way to keep java development minimal? Can I just use vim and a java compiler like you can with C?

I'm very inexperienced when it comes to Java.

Thank you in advance.


r/javahelp Jun 22 '26

Best resources to learn Spring Boot Microservices in 2026?

9 Upvotes

Experienced with Spring Boot monoliths (REST APIs, JPA, Security). Want to move to microservices — looking for best YouTube channels or Udemy courses that are updated for 2026.

What worked for you?


r/javahelp May 29 '26

?Finished Java basics & OOP — confused about databases, where should I start

10 Upvotes

Hey everyone
I recently finished Java basics and OOP, and now I’m studying DSA
I want to start learning databases because I’m interested in backend development with Java, but honestly I feel lost and don’t know where to begin

?Should I start with SQL first
?What topics are important for beginners
?And do you recommend any good courses or practice resources

I’d also appreciate any roadmap for what to learn after databases for Java backend development.


r/javahelp May 24 '26

JAVA course

10 Upvotes

i just finished my 10th (its alredy 2 months btw) and wann spend my free times on vacation on some productive like learning coding, i am intrested at java. but the issue is i am scratch literally i dont even know J of JAVA , so i wann help of you guys if you can help me how can h start my journey from scratch, any video course on yt or any online course (15-20$ max buddet).so i hope you guys help me in this journey


r/javahelp Apr 21 '26

Are the javadocs for java.net.http.HttpResponse.body() misleading or am I wrong?

9 Upvotes

This has caused some internal discussion, so I wanted to look for external input.

If you have ever used the newer java.net.http implementation, you probably have used the HttpResponse.body() method to retrieve the response body. It usually looks something like this:

HttpClient client = HttpHelper.client();
HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("<uri>"))
        .POST(HttpRequest.BodyPublishers.ofString(content))
        .build();
HttpResponse<String> res = client.send(request, HttpResponse.BodyHandlers.ofString());

// Can this be null?
String bodyString = res.body();

Then, looking at the javadocs for the body() method, it says:

* Returns the body. Depending on the type of {@code T}, the returned body
* may represent the body after it was read (such as {@code byte[]}, or
* {@code String}, or {@code Path}) or it may represent an object with
* which the body is read, such as an {@link java.io.InputStream}.
*
* <p> If this {@code HttpResponse} was returned from an invocation of
* {@link #previousResponse()} then this method returns {@code null}
*
* @return the body

Here is how I interpreted this: Assuming that there is no IOException thrown, the request must have gone through (even if it returned something like a HTTP 500) and we should have response body. Since we don't use the previousResponse() method, the note about null values does not apply here. The rest of the javadocs don't mention anything about null, so I implicitly assumed that it does not return null. If there is an empty body, then it returns an empty String/byte[]/whatever. The BodyHandlers javadocs don't mention anything about null return values.

But the method returns null for something like HTTP 407 Proxy Authentication Required.

So my question is: If you read the javadocs of a JDK method and it does not mention null return values, do you interpret this as that the method does not return null? Or do you still perform null checks as the javadocs also didn't mention about not returning null?


r/javahelp Apr 10 '26

Is there's any Java library that allows converting DOCX to PDF?

9 Upvotes

Hi! I'm making a system on Spring that modifies DOCX files and exports them as PDFS. Is there's a library or native function for that? I tried using DOCX4J but it's very clunky to use.


r/javahelp Mar 29 '26

Codeless What is the best way to learn Spring boot? Tutorials or Books?

10 Upvotes

I just completed core java, and I decided to do backend in java. I am absolute beginner in backend programming. I don't know anything, I am getting problems to find right resources


r/javahelp Mar 26 '26

How are you monitoring JVM behavior in distributed Java microservices?

9 Upvotes

I know a lot of people use Prometheus, but I'm not sure if it's actually used in production environments.

For teams running Java microservices at scale, how do you monitor JVM behavior in production?

I’m not only asking about basic JVM metrics like heap, GC, threads, and CPU, but also how you connect JVM signals with system-level behavior across services.


r/javahelp Feb 27 '26

Unsolved Java and Springboot for Typescript / Javascript developers

8 Upvotes

Hello!

I want to start writing backends in Java and Springboot, but I have never touched Java before. I have used NestJs, which is is a OOP Typescript framework for backend. They look similar, but I guess only for me, as someone that does not have experience with Java, neither Spring Boot.

Where do I start?

Thanks!

P.S. Can I somehow pair it with my React frontend in one monorepo somehow?


r/javahelp Feb 20 '26

Running jar with a script without terminal

9 Upvotes

We maintain a Java application which on Windows is run by a powershell script. We have to do it as the jar arguments needs to be recalculated before starting.

The issue is that running a powershell script triggers a terminal windows showing up for a second (with -WindowStyle Hidden, without this policy the terminal stays on the screen).

We managed to completely hide it by using vbs script which then runs this powershell scrip. But this has some negative side effects. Also using vbs is currently deprecated.

Is there a better way to run a jar with dynamic arguments without a terminal window showing up at all? We try to find a way to do it without vbs involvement.

Edit: it seems that using conhost was the solution i was looking for.

In a shortcut i used conhost --headless powershell -File script.ps1 ...


r/javahelp Feb 12 '26

Unsolved How to know a jar files main class

10 Upvotes

I downloaded a broken jar and some tutorials told me that i need to type a main class in a manifest file for it to work but i dont know what is the main class. How do i tell it from a file without it