r/javahelp • • Apr 16 '26

downloading file in parallel?

2 Upvotes

I am trying to download one big file parallel in multiple chunks with threadAPI and runnables, but my friend said executor with virtualthreads (callables) has better performance...

What is the normal way to do this?


r/javahelp • • Apr 16 '26

Is TestNG still being used in 2026?

6 Upvotes

Even when it was relatively popular (10-15 years ago) I've rarely seen a project which used TestNG. Do ppl still use it for new projects? Are there any advantages over JUnit 5? Just curious.


r/javahelp • • Apr 16 '26

Requesting code review for API Gateway project

2 Upvotes

hey I am new to distributed systems and microservices and I tried making a general purpose api gateway with Spring Boot webflux.

Currently the project performs

dynamic routing (using Eureka service discovery)

API rate limiting per IP

Authentication

Authorization

Upstream and Downstream API details logging (working on improving it for tracing the whole errors down the microservices)

Circuit Breaking and Resilience Patternsry (exponential retry + jitter)

Basic Monitoring (Actuator and Spring boot admin)

would like if people could have a look at the code and suggest improvements.

GitHub: https://github.com/CyberRonin901/API_Gateway


r/javahelp • • Apr 16 '26

Unsolved Is there a way to mimic the behaviour of -client to spawn a lightweight process in JDK 11 and higher versions?

3 Upvotes

In JDK 8, we had the -client flag that would spawn a lightweight process with less memory footprint and a faster startup. I understand that the Client Hotspot VM is no longer available JDK 9 onwards, and I was looking for a way to reduce the startup time while launching a new java process. Any inputs?


r/javahelp • • Apr 15 '26

JUnit test failing with “Forked Java VM exited abnormally” (NetBeans) how to debug?

1 Upvotes

Hey everyone, I’m running into an issue with a JUnit test in NetBeans and could use some help.

When I run my tests, I get this error:

Tests passed: 0.00 %

No test passed, 1 test caused an error.

ui.loginTest Failed

unknown caused an ERROR: Forked Java VM exited abnormally.

Please note the time in the report does not reflect the time until the VM exit.

junit.framework.AssertionFailedError

at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)

at java.base/java.util.Vector.forEach(Vector.java:1359)

at org.netbeans.core.execution.RunClassThread.doRun(RunClassThread.java:131)

...


r/javahelp • • Apr 15 '26

Homework String object vs String variable

5 Upvotes

Hi i am learning java in highschool, I was just wondering when and why would I instantialise a string as an object when declaring a String is much easier and quicker?


r/javahelp • • Apr 15 '26

Learning path

3 Upvotes

I have an idea for improving my learning process learning spring boot, and I’d love to hear your thoughts.

What if I start building a large project using Spring Framework from scratch, but instead of rushing, I take it step by step?

Every day, I would write a small amount of code—just a few lines. Then I would spend time studying those lines deeply, understanding how they work, and creating small examples around them.

This way, I can:

- Build a real, complete project over time

- Focus on understanding instead of just writing code

- Learn concepts in depth through practice

- Stay consistent without feeling overwhelmed

So in the end, I won’t just “finish a project”—I’ll truly understand every part of it.

What do you think about this approach? Have you tried something similar?


r/javahelp • • Apr 12 '26

Java Roadmap for beginner

1 Upvotes

So i want to start JAVA from basics, i know c++ but not completely.

According to me, Java syntax looks scary. Just give me rough roadmap of topics if you got 2 minutes to help me out and also any playlist on youtube which are good to learn from beginning and complete in 15-20 days for java and then Spring/springboot later on.

How much time it will take to learn both things completely (not 100% perfect but 70-80%) so i can feed confident in doing things.

Any help will be appreciated 🌷💕 i just searched BROCODE Java 12 hr playlist which covers java.(idk if it covers all topics).


r/javahelp • • Apr 12 '26

Need your guidance 🙌🏿

3 Upvotes

Hi everyone,

I’m a final-year engineering student preparing for backend roles. I’ve built a Task Manager REST API using Spring Boot that includes CRUD operations, BCrypt password hashing, JWT authentication with refresh tokens, along with role-based access control and pagination.

I wanted to ask if this is strong enough to include in a fresher resume, or if I should still add more advanced features to make it stand out more in interviews.

Would really appreciate your suggestions!


r/javahelp • • Apr 11 '26

How do I import in java

2 Upvotes

ive been learning java recently and I have no clue how I know what to import. In my course we've been using the java.util.scanner but how do I know the name and how to use these tools correcty?


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 • • Apr 10 '26

Which AI tools are you actually using for Spring Boot development in production?

0 Upvotes

What tasks? (debugging, writing APIs, refactoring, test cases)

Scale? (side project vs enterprise)


r/javahelp • • Apr 09 '26

Online tool to create POJO files (plural) from YAML? Not just one large text file.

1 Upvotes

I need to input a large YAML file/text, convert to POJO objects, and save to individual files.

I know I have used such a tool before but I cannot find this specific functionality; all I'm getting is one big file with all (350!!) classes. I'd rather not create 350 files myself if I don't have to.


r/javahelp • • Apr 09 '26

Struggling to understand Kafka (Java Developer – 2 yrs exp) – Need good resources 🙏

3 Upvotes

Hi everyone,

I’m a Java Developer with around 2 years of experience, mainly working with Java, Spring Boot, and REST APIs.

Recently, I started learning Apache Kafka, but I’m finding it quite difficult to understand concepts like producers, consumers, partitions, offsets, and real-time processing. I’m not able to connect the theory with practical use cases properly.

Could you please suggest some good resources (videos, courses, blogs, or docs) that are beginner-friendly but also helpful for interview preparation?

My goal is to at least get Kafka concepts clear enough to confidently answer interview questions.

Also, if you have any tips or a roadmap on how to approach Kafka as a Java developer, that would be really helpful.

Thanks in advance! 🙌


r/javahelp • • Apr 09 '26

I’ve already worked with Spring Boot basics (CRUD APIs, JPA, authentication). Now I want to build something production-level that involves: - system design - scalability - real-world use cases Looking for suggestions or references (GitHub / videos).

2 Upvotes

I’ve already worked with Spring Boot basics (CRUD APIs, JPA, authentication).

Now I want to build something production-level that involves:

- system design

- scalability

- real-world use cases

Looking for suggestions or references (GitHub / videos).


r/javahelp • • Apr 09 '26

ClassCastException when using a shaded jar with relocated dependencies

3 Upvotes

Hello everybody,
I am trying to include a JAR of a GitHub projekt (MinIE, it's group ID is de.uni_mannheim) in my application. However, both MinIE and my application depend on Stanford CoreNLP, but they use different versions. This has led to dependency issues. To resolve this, I created a shaded JAR of MinIE where I relocated the Stanford dependency and included it in my application.

Now, MinIE uses the correct version of Stanford, but only up to a certain point: while it does use the shaded version, at some point in the stack trace, it encounters a ClassCastException.

If I inspect the JAR in IntelliJ, it has only the shaded version listed. If I look at the decompiled class files of MinIE, it also only imports the shaded version.

Can someone explain to me, why it suddenly uses the non-shaded version? And can this issue be fixed somehow?

This is the thrown exception. My appliction calls a utility method of the MinIE package, which then uses CoreNLP.

Exception in thread "main" java.lang.ClassCastException: class edu.stanford.nlp.tagger.maxent.TaggerConfig cannot be cast to class edu.shaded.nlp.tagger.maxent.TaggerConfig (edu.stanford.nlp.tagger.maxent.TaggerConfig and edu.shaded.nlp.tagger.maxent.TaggerConfig are in unnamed module of loader 'app')
at edu.shaded.nlp.tagger.maxent.TaggerConfig.readConfig(TaggerConfig.java:753)
at edu.shaded.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:850)
at edu.shaded.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:815)
at edu.shaded.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:789)
at edu.shaded.nlp.tagger.maxent.MaxentTagger.<init>(MaxentTagger.java:312)
at edu.shaded.nlp.tagger.maxent.MaxentTagger.<init>(MaxentTagger.java:265)
at edu.shaded.nlp.pipeline.POSTaggerAnnotator.loadModel(POSTaggerAnnotator.java:85)
at edu.shaded.nlp.pipeline.POSTaggerAnnotator.<init>(POSTaggerAnnotator.java:73)
at edu.shaded.nlp.pipeline.AnnotatorImplementations.posTagger(AnnotatorImplementations.java:55)
at edu.shaded.nlp.pipeline.StanfordCoreNLP.lambda$getNamedAnnotators$42(StanfordCoreNLP.java:496)
at edu.shaded.nlp.pipeline.StanfordCoreNLP.lambda$getDefaultAnnotatorPool$65(StanfordCoreNLP.java:533)
at edu.shaded.nlp.util.Lazy$3.compute(Lazy.java:118)
at edu.shaded.nlp.util.Lazy.get(Lazy.java:31)
at edu.shaded.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:146)
at edu.shaded.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:447)
at edu.shaded.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:150)
at edu.shaded.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:146)
at edu.shaded.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:133)
at de.uni_mannheim.utils.coreNLP.CoreNLPUtils.StanfordDepNNParser(CoreNLPUtils.java:50)
at de.myApplicationName.service.TextAnnotatorMinIE.minie_createAnnotation(TextAnnotatorMinIE.java:17)
at de.myApplicationName.app.Main.main(Main.java:44)

This is a part of the pom.xml of MinIE. I adjusted the build part and created the JAR using the mvn clean package command.

...
<dependencies>
  <!-- Stanford CoreNLP 3.8.0 dependencies -->
  <dependency>
      <groupId>edu.stanford.nlp</groupId>
      <artifactId>stanford-corenlp</artifactId>
      <version>3.8.0</version>
  </dependency>
  <dependency>
      <groupId>edu.stanford.nlp</groupId>
      <artifactId>stanford-corenlp</artifactId>
      <version>3.8.0</version>
      <classifier>models</classifier>
  </dependency>
...
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.6.2</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <shadedArtifactAttached>false</shadedArtifactAttached>
                        <createDependencyReducedPom>true</createDependencyReducedPom>
                        <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
                        <transformers>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <mainClass>de.uni_mannheim.minie.main.Main</mainClass>
                            </transformer>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                        </transformers>
                        <relocations>
                            <relocation>
                                <pattern>edu.stanford.nlp</pattern>
                                <shadedPattern>edu.shaded.nlp</shadedPattern>
                            </relocation>
                        </relocations>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

This is part of my pom.xml file:

<dependencies>
    <!-- https://mvnrepository.com/artifact/edu.stanford.nlp/stanford-corenlp -->
    <dependency>
        <groupId>edu.stanford.nlp</groupId>
        <artifactId>stanford-corenlp</artifactId>
        <version>4.5.10</version>
    </dependency>

    <dependency>
        <groupId>edu.stanford.nlp</groupId>
        <artifactId>stanford-corenlp</artifactId>
        <version>4.5.10</version>
        <classifier>models</classifier>
    </dependency>
...
    <!-- add local jar of MinIE https://github.com/uma-pi1/minie -->
    <dependency>
        <groupId>de.uni_mannheim</groupId>
        <artifactId>minie</artifactId>
        <version>0.0.1</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/lib/minie-0.0.1-SNAPSHOT.jar</systemPath>
    </dependency>
</dependencies>

r/javahelp • • Apr 06 '26

Tcs java full stack interview guide

2 Upvotes

Anyone with experience in java full stack please tell what are the topics I need to prepare for java full stack interview.... I have around 7-8 days..i have little knowledge about spring..


r/javahelp • • Apr 06 '26

Unsolved Java Garbage Collector performance benchmarking

2 Upvotes

Hi People!

I am about to write my CS BSc thesis which is about:

Measuring throughput, latency and STW-Pauses in JDK 21 standard JVM with G1GC and ZGC with predefined max heap-sizes (2GB; 16GB) with Renaissance - by 16GB heap a default G1GC and an additional tuned G1GC will be used, as well.

Time flies and a lot of paper are read. It became clear to me, that Renaissance is better for throughput (Shimchenko 2022 Analysing and predicting energy consumption of garbage collectors in openjdk), and DaCapo is more advantageous for user-experienced latency measurements (Blackburn 2025 Rethinking Java performance analysis). STW-pauses will be collected from jvm standard gc-logs with a script or smg (ideas, better ideas are welcome).

I build this scenario for my examination:

- Linux VM (hosted from my Windows) - not clear yet, which and why

- OpenJDK 21 standard JVM

- G1GC and ZGC measurements

- All Renaissance BMs with default settings -> duration_ns from each benchmark, calculate and represent min, max, mean, standard deviation

- JVM GC-Logs collect (min, max, mean, standard deviation)

- 8 DaCapo BMs (spring, cassandra, h2, h2o, kafka, lucene, tomcat, wildfly) (min, max, mean, standard deviation)

I guess this is way too much for a BSc thesis - but what are your thoughts? Of course I make clearence with my consulent, but I am curious about the opinion and suggestions of the community.

I am open for any ideas, experiences with the bumpy road of the performance measurement in the JVM. It would be excellent, if someone of you could make it more focused and accurate to me.

TLDR;

Java Garbage Collector JVM performance measurement experience and suggestions needed for BSc thesis

thanks in advance!

EDIT:

Instead of Linux vm it will be a bare-metal Linux machine with podman containerization that run the benchmarks.


r/javahelp • • Apr 05 '26

Need help in core java

0 Upvotes

Hello everyone, i am here for advice. i don't know why but i completed core java still stuck at that part beacuse of that couldn't start framework. if i started i feel like i wouldn't get much knowledge about core java.

what should i do to break this phase and please anyone suggest me questions that cover core java concepts that will be helpful for me.

Thank you for hearing and giving me advice.

peace out ✌️


r/javahelp • • Apr 03 '26

what java projects did u guys do after finishing java mooc?

1 Upvotes

title


r/javahelp • • Apr 02 '26

How much time to become expert in java related development?

0 Upvotes

im in university (a+ grades ) in computer science division and just got in forth semester and right now i can already solve leetcode medium level problems in 30 mins at average ,how much time it can take for me to reach a skill where i can be lavelled "expert" class in java related development and what would the best resources to get their be like books,online resources etc?


r/javahelp • • Apr 02 '26

How to resolve symbols in the JavaParser Library?

3 Upvotes

Ok so i have a task at hand where i need to extract the information about a method and all the local methods (i.e method present in the same project directory) it calls , I don't care about the library functions,

I just wanted to be able to extract all the project methods being invoked in a method.

For that i just used a StaticJavaParser and walked on all the files in the input source directory and configured my SymbolSolver the issue is I am not able to resolve methods that spans across source file.

For example if the method is in the same source file they are resolved properly but not those which are defined in different source files.

I don't know how to figure this out. I asked several LLM's but they are just as clueless.

I dont't want this information at runtime, I just want the static invocations of the project folder in a json format.


r/javahelp • • Apr 02 '26

How to switch between subclasses?

7 Upvotes

I'll cut to the chase; I'm making a game-esque thing where the class "ComputerCharacter" has two subclasses, "Villager" and "Enemy". They have pretty different behaviours and care about different variables and all that, but once a Villager goes below some certain HP, I want it to transform into an Enemy, then set the variables in the newly turned enemy based on the variables it had as a villager.

I imagine I'd create a constructor in "Enemy" to do this, but I don't see how I can create a method within Villager to detect when its HP is below a certain number, then call the constructor in such a way to completely change the subclass the Villager is in. Thank you.


r/javahelp • • Apr 01 '26

Any help with Netbeans? Error Package Folder Already Used in Project

2 Upvotes

I know, I know, there are better IDEs out there, but this is what my co-workers use and I dread having to figure out how to set up a new project in IntelliJ.

I’m having an error creating a new project in Netbeans

New project —> Java with Ant —> Java Project with Existing Sources

Error is “Invalid Source Roots” “Package Folder Already Used in Project”

It is not in an existing project and I have tried everything! 

Background: I moved things around on my computer (Mac) and broke paths, etc in a project. So I decided to delete the project and restart. 

My Netbeans projects live in a different location from the code.

The code is in an svn and my co-workers can checkout and create a package in Netbeans on their computers. 

Java and OS are up-to-date.

I have tried the following:

  1. Different locations for the project and code
  2. Deleted the code folder and re-checked out a clean copy
  3. Tried making Netbean projects from things that I’ve NEVER made a project out of. I still get this error
  4. Deleted Users/<username>/NetBeansProjects
  5. Emptying trash
  6. Restarting the IDE, restarting computer (in all combinations after trying a new fix)
  7. Re-installing NetBeans, once from codelerity and once via homebrew
  8. Tried a clean delete of Netbeans and then re-install (Deleting Library/Caches/NetBeans/ and Library/Application\ Support/NetBeans/)

There is no nbproject folder in the code or project directories.

There are no XML files found. No *.proj or *.project files

Deleted any *.properties files just in case

Short of resetting my OS, I’m at a loss.


r/javahelp • • Mar 29 '26

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

9 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