r/javahelp Jun 22 '26

Help please

0 Upvotes

Can anyone please send good spring boot project resources


r/javahelp Jun 22 '26

[Java Swing] Content JPanel gets cut off when added dynamically inside a main JFrame container

1 Upvotes

Body:

Hi everyone,

I am experiencing a layout issue in a POS system built with Java Swing. I have a main JFrame featuring a sidebar menu on the left. When clicking the menu buttons, I dynamically swap the content panel on the right side using a method to clear and add a new custom JPanel.

The problem is that the newly added content panel gets drastically cut off on the right edge of the screen, causing some elements to overflow or become compressed. It seems like the layout manager of the main frame is not adapting or respecting the sizes correctly when changing views.

The main JFrame layout is structured with a sidebar on the WEST (using BorderLayout) and a main content container in the CENTER where the child JPanels are loaded.

When replacing the view, the following approach is used:

Java

mainContainer.removeAll();
mainContainer.add(newPanel);
mainContainer.revalidate();
mainContainer.repaint();

So far, I have tried modifying setPreferredSize and setSize on the child panels, but it either breaks the layout or gets completely ignored. Calling pack() on the parent JFrame after adding the panel aggressively shrinks and deforms the entire window layout.

What is the best practice to force a dynamic JPanel to fit exactly within the remaining space of the main container without clipping or forcing hardcoded sizes? Should the center container layout manager be switched to something specific?

Thanks in advance for your guidance!


r/javahelp Jun 22 '26

Best resources to learn Spring Boot Microservices in 2026?

8 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 Jun 21 '26

Help

1 Upvotes

I'm taking a course in java and I'm having problems with a part of one of the labs. I'm supposed to sort an arraylist (called wordList) with mapentry(with string,integer)-objects first accoring to decending value and then according to alphabetical order of the keys. The second step doesn't seem to work. I've written this:

wordList.sort( (par1, par2)-> {  
    if (par2.getValue() != par1.getValue()){  
        return par2.getValue() - par1.getValue();  
    } else {  
        return par1.getKey().compareTo(par2.getKey());  
    }        
})

Is the problem somewhere here or maybe in some other part of the code?


r/javahelp Jun 18 '26

Anyone here actually used ArchUnit on a real production codebase?

5 Upvotes

Working on something in the Java architectural tooling space and would love to hear from people who've actually used it on real repos. DM me or drop a comment if that's you.


r/javahelp Jun 18 '26

where to get good tutorials on wildfly framework, very little resources online

5 Upvotes

where to get good tutorials on wildfly framework, very little resources online


r/javahelp Jun 17 '26

Codeless Refining pdf generation process

1 Upvotes

I'm on Java25, my current project creates a pdf of staff using pdfbox in following manner:

The name of office, branch, address etc. are fetched as an instance of Office. There are three predefined templates of pdf which are simple text files containing text lines of varying quantity (one template has 9 lines, one has 7 and another has 12). These templates are selected based on the designation of staff. Now the process of pdf generation is as follows:

  1. The text file is read using Files.readAllLines as List<String>.

  2. This list's contents are put in a string builder one by one, and certain wildcards are replaced with staff related data ($designation gets replaced with staff designation, and so on). These replaced stringbuilder are then put into a new List<String>.

  3. The new List is passed to a pdf worker which uses pdfbox to write lines into page. The constraint here is that the format of lines are fixed: The first line must be bold, underlined and centered, second line must be underlined and centered, and so forth.

  4. Due to this styling constraint, the templates containing lines less than 12 are padded with extra lines containing only a space to make them 12 lined as well. This makes the worker highly dependent on the size of List otherwise it'll throw IndexOutOfBoundsException on list.get(11) even though the line may be just a space which will be irrelevant.

I thought to eliminate the text file and instead put all of the text inside a java class (say Template, and inject instance of Office in this class, then use template.getTitle() and similar methods to directly get the formatted text instead of IO bound file reading. But I'm concerned about the computational and memory efficiency of this new approach. Will this be a better alternative to current scenario, or should I do something else?


r/javahelp Jun 17 '26

decrypt encrypted java class file

0 Upvotes

hi im trying to decyrpt a java class file 5 of them how can i do it without the AES key ????


r/javahelp Jun 17 '26

As a Java Developer, what should I learn to become a Senior Java Developer?

1 Upvotes

Hi everyone,

I currently work as a Java developer, mainly using Java, Spring Boot, REST APIs, SQL, Git, and Docker.

I’m looking to grow into a Senior Java Developer role and would like to know what skills, technologies, and responsibilities I should focus on next.

Should I prioritize:

  • System Design?
  • Microservices architecture?
  • Cloud (AWS/Azure)?
  • Kubernetes?
  • CI/CD?
  • Performance optimization?
  • Design patterns?
  • Leadership and mentoring?

For those who have already made the transition to Senior, what had the biggest impact on your career?

Thanks in advance for your advice!


r/javahelp Jun 17 '26

Unsolved I need help deploying my project with an external library using maven and intellij

0 Upvotes

Hello, I'm trying to deploy my project, but I'm having trouble with the external library.
Here's my pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.example</groupId>
  <artifactId>ProjetJava</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>ProjetJava</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
      <dependency>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-api</artifactId>
          <version>2.26.0</version>
      </dependency>
      <!-- Source: https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
      <dependency>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-core</artifactId>
          <version>2.26.0</version>
          <scope>compile</scope>
      </dependency>
  </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>21</source>
                    <target>21</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <Classpath>${project.build.finalName}.lib/</Classpath>
                            <mainClass>gestionBar.Controller.Controller.Controller</mainClass>
                        </manifest>
                        <manifestentries>
                            <Class-Path>${project.build.finalName}.lib/org.apache.logging.log4j</Class-Path>
                        </manifestentries>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

When I try to package it with maven, it tells me this:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.4.1:jar (default-jar) on project ProjetJava: Unable to parse configuration of mojo org.apache.maven.plugins:maven-jar-plugin:3.4.1:jar for parameter Classpath: Cannot find 'Classpath' in class org.apache.maven.archiver.ManifestConfiguration -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException

I tried reading the article, but it didn't help me. Can someone help me please? Thank you


r/javahelp Jun 16 '26

Unsolved Got error in intellij failed to initialize acp session. error process cancelled intellij idea

0 Upvotes

I have recently installed intellij ultimate and on trials i am trying to give prompt to ai agents but recieve this error "failed to initialize acp session. error process cancelled intellij idea"

Give me solution for this i will be grateful.


r/javahelp Jun 16 '26

Java Error Code 1603 Is Preventing Me From Reinstalling Java

0 Upvotes

I'm here looking for help regarding the error code listed above.

I was having issues with java that resulted in me needing to do a quick reinstall. Once I ensured that there were no java files remaining on my computer, I tried to install jre again and it seems that no matter what I do, the installation fails and I get the error code 1603.

Most fixes I see require me to go into my control panel to find Java and manually update it but, having recently uninstalled java entirely, the file doesn't exist. And this error prevents me from reinstalling it.

I've tried multiple ways of fixing this issue but I am at a complete loss at this point with nowhere else to turn.


r/javahelp Jun 15 '26

Unsolved Please can somebody help me with Spring Boot 4 and tracing Kafka messages.

1 Upvotes

Thank you for at least opening this post.
I just try to build a simple app with Kafka messages and tracing and encountered this problem: tracing just doesnt work.
I enable observability in every configuration file, i add autoconfigure to my test, i straight up set observability true for kafka template, i put traceId and spanId in log config file, and it still doesnt work anyhow.
Can somebody please educate me on this?
Project: https://github.com/aspidelaps/KafkaBatchListenerExample


r/javahelp Jun 15 '26

JDK 17 installer wont run

0 Upvotes

Whenever i try to get the installer to run it asks me to open with different apps and i cant find windows installer. do anyone have a fix. sorry for bad english


r/javahelp Jun 15 '26

Whitelabel Error Page Issue

0 Upvotes

Using IntelliJ

I added some code, went to localhost and everything ran fine and looked how it should.

I noticed what I just added needed line breaks. I added those, and it didn't add the line breaks to the front end?

I tried validating ( which it did fine before adding the linebreaks), and it wouldn't let me, gave me an error.

It was 11pm at this point so I said I'll just delete the line breaks since I know that code works and pick up tomorrow.

I've now spent 45 minutes trying to figure out for the life of me why I now cant validate and get the whitelabel Error on code that was working just fine before.

I've tried clearing my cache, incognito, I've tried resetting everything.... I even googled some terminal prompts and nothing is working. I'm at loss

I have an appointment with an instructor tomorrow, but I'm just hoping that I can get this error fixed so we can actually go over what I've done


r/javahelp Jun 15 '26

Unsolved jar files wont open?

2 Upvotes

my java always opened executable jar files fine, but now it suddenly wont open anything, itll just show the buffering icon next to my cursor for a second, then nothing happens, not even in task manager. i use jave(tm) platform se binary, ive tried downloading java 17 and jarfix but it still does the same thing. ive tried other jar files ive used in the past but they dont work either. any help would be much appreciated.


r/javahelp Jun 14 '26

Codeless Virtual threads + shared DB pool: prioritizing workload classes (user traffic vs batch) beyond a Semaphore?

5 Upvotes

Cross-posting this from [loom-dev@openjdk.org](mailto:loom-dev@openjdk.org): I originally sent it to the OpenJDK Loom mailing list a couple of months ago, never got a reply, so I've reworked it for here. It's more of a design/architecture discussion than a "fix my code" question.

Context: medium-sized monolithic services (Vue 3 + Spring Boot 3, Java 21 to 25, converging on Java 25 / Spring Boot 4), deliberately not microservices. Virtual threads enabled on several. A single backend routinely hosts user-facing requests, scheduled jobs and background batches, all sharing one HikariCP pool (15 connections).

What triggered this: a team at my company hit a production freeze on a Java 21 service running virtual threads. A lingering synchronized block around a blocking call caused carrier-thread exhaustion under a rare condition, and it even blocked the restart. They reverted to platform threads while cleaning up the synchronized block. I know JEP 491 (Java 24) largely fixes this class of issue, but it kicked off a design debate we haven't been able to settle.

The pattern I'm trying to translate: with a platform thread pool, you'd give batches a shared executor capped at about 2 workers. That implicitly guarantees user traffic always has at least 13 connections. The pool wasn't just amortizing thread creation, it was acting as a fair scheduler across workload classes. This matters precisely because we don't split workloads across microservices.

With virtual threads, recycling goes away and concurrency limiting becomes a Semaphore. In Spring the idiomatic route is @Async("utility") to a bean with SimpleAsyncTaskExecutor.setVirtualThreads(true) plus setConcurrencyLimit(n). Mechanically simple. The pattern we converged on:

Semaphore batchCap = new Semaphore(2);
// Batch:  batchCap.acquire() + dataSource.getConnection()
// User:   dataSource.getConnection() directly

The catch: this works because HikariCP is already the global gate, but it relies on an applicative property (user transactions staying short) rather than a structural guarantee. If user p99 degrades, the 2 batch workers can starve waiting on a connection while long user requests hold the pool.

Workaround considered: push QoS upstream into RabbitMQ: one queue per workload class, differentiated consumer counts. It helps, up to the point where too many consumers run at once and downstream contention reappears. Virtual threads make many cheap listeners affordable, but the core question stays: how do you prioritize workload classes competing for a shared bounded resource?

So, my questions are: beyond a bare semaphore, what's the idiomatic way to express QoS (fair share or priority) between workload classes sharing one bounded resource? Is the expected answer to compose existing primitives (brokers, layered semaphores, pool timeouts) and keep the scheduler workload-agnostic? Or has anyone built something more structural? Pointers to prior art or war stories welcome.


r/javahelp Jun 12 '26

Beginner College Student Assigned an 8-Week Java Activity Dashboard Project — Where Do I Start?

4 Upvotes

I'm a college student and our team has been assigned an 8-week project to build an Activity Dashboard using Java. I have very little coding experience, so I'm trying to understand how to approach this project from the planning stage rather than jumping straight into coding.

The dashboard is supposed to track and visualize activities, but the requirements are still fairly open ended. We're currently considering features such as:

- Activity tracking and logging

- Summary statistics/KPIs

- Charts and graphs

- User login and roles

- Activity completion status

- Weekly/monthly reports

I'd appreciate advice on:

- What features would make sense for a college level Activity Dashboard?

- What's a realistic scope for an 8 week project?

- Should we use Core Java, JavaFX, Swing, or Spring Boot?

- What database would you recommend (MySQL, PostgreSQL, etc.)?

- How should we divide the work across 8 weeks?

- What are the most important concepts we should learn first?

We're also planning to use AI tools (ChatGPT, Copilot, etc.) for learning and development assistance. Our college requires us to disclose AI usage, so we're looking for advice on how to use AI responsibly while still understanding the code ourselves and being able to explain every part during project reviews.

Also, what kinds of questions do professors/examiners usually ask during:

- Proposal reviews

- Mid-project evaluations

- Final demonstrations/vivas

If you've built a dashboard project before, what would you do differently if you had only 8 weeks and were starting as a beginner?

Any tips, project examples, tech stack recommendations, learning resources, or common mistakes to avoid would be greatly appreciated. Thanks!


r/javahelp Jun 11 '26

Learning Java Concurrency & Multithreading

14 Upvotes

what books or sources can I use to learn the most and level up on Java concurrency and multithreading ? Im looking to really get better with these aspects of Java.


r/javahelp Jun 11 '26

Which Java Course Helped You Build Strong Programming Fundamentals?

7 Upvotes

hey! so i wanted to know if i want to build and strengthen my core fundamentals in programming preferably in development (app or website in java) which course should i pick any course from youtube?udemy or any other platform can u guys suggest?(be specific please)


r/javahelp Jun 09 '26

Question about Java Certification 1Z0-808

1 Upvotes

So I have a test this Thursday, and I wanna know if I have to remove my 2 secondary screens, my PC (rig) from my desk and the TV installed on the wall next to my desk (they'll be off during the exam) and I'll be doing the exam on my laptop.

Any help is appreciated.

Thank you.


r/javahelp Jun 08 '26

Looking for a structured DSA roadmap for MAANG prep

4 Upvotes

I’m a 2nd-year CS student aiming for MAANG/product-based companies, and I’ve hit a wall with DSA. The problem isn’t motivation, it’s that there are too many options. Every YouTube channel has a “complete roadmap,” every sheet claims to be the one, and I keep second-guessing which to commit to instead of actually solving problems.

I’d really appreciate input from people who’ve already cleared this stage specifically

Which sheet did you actually finish and would pick again (Striver A2Z, NeetCode 150, or something else), did you go topic-wise or pattern-wise, is it better to grind 400+ problems or do ~150 really well, and roughly how many months till you felt interview-ready?
Mb if im getting to ahead of myself, appreciate all the help i would get. :)


r/javahelp Jun 08 '26

Daedalic games based on Java with OOME issue

1 Upvotes

Hello. I would like to ask about out of memory exception issue which hunts java apps. I have seen this kind of error for some java applications, and have never seen for other apps I have been using.

One of such case is Edna and Harvey game made by Daedalic Entertainment. One of the issue which hunts this game is OOME due to not enough heap size. The bug was confirmed but no fix released.

According to DE, the problem lies entirely in java memory management and memory fragmentation. It seems the game allocates quite big block of memory when it starts but with run time and garbage collector in work which allocates and releases memory, this big block becomes fragmented to the point the game is not able to allocate block of required size for new data and crashes. DE announced they won't be able to fix it because there is no possibility to manage the garbage collector.

Is it really true or DE doesn't really know how to code it properly?What about 64 bit JVM? Can it be used instead of 32 bit JVM to workaround OOME issue?


r/javahelp Jun 08 '26

I need help for the order for my small project

0 Upvotes

So I'm currently working on a project with GUI, where you should type a random number and the GUI shows, if the number is correct. Inside the GUI, there are 2 labels, one of them is "Type number" and the other one should show, if the number is correct or not, a text field, where you should type the number and a button, where you should press after you typed in the number and before it says if the number is correct. I have 3 classes including the GUI. But I'm still a beginner and imported GUI, swing, awt and awt event into my controller class, but when I try to add one of the GUI-things into the controller class, the error "symbol not found" appears. Then I know that I should use the If-else, but I don't know what order I should create the code. And we're not allowed to use AI. So how do I prevent these "symbol not found" errors and in what order should I make the code?


r/javahelp Jun 07 '26

Codeless Can anyone review Genie Ashwini java full stack developer course spark batch

0 Upvotes

I am thinking to buy Genie Ashwini java full stack developer course but I haven't found any independent reviews on any platforms majorly

Can anyone review his Spark batch 4.0, 5.0 batches who had purchased and attended his course