Java Community | Help. Code. Learn.

JCH

Java Community | Help. Code. Learn.

We are a Community full of Java developers. Connect with other devs, get help, help others and do much more!

Join

java-help

❓︱qotw-answers

Cooldown Error

1) It's showing me this, how should I fix it? 2) How can I make it into seconds, rather then having it into miliseconds?...
No description

Wanna be Java Dev

I want to be an java dev I learned collection framework but now stuck wheather to start spring core or spring boot so what do I do and also I struggling to find resoucres if anyone could help me with the roadmap and resources(apreeciated if its a yt resource)pls help me.....

Hello everyone,

Im new here and im also new to JAVA.Does anyone have resources for learning? Im up for courses, books, anything really

JDK custom

I need to customize the JDK.

Spring Boot app (Hikari + Quartz + MySQL) randomly loses DB connections, floods logs until restart

I have a Spring Boot app using HikariCP (MySQL on AWS RDS) and Quartz with a JDBC job store. It runs fine for days, then suddenly stops getting DB connections. Logs fill up, and it won’t recover until I restart. After restart, it runs fine again. --- Example logs...

Accessing multiple files from internal resources

I have a lot of files that are packaged into the jar, I'm using these for something like a data based approach (I guess). And now I'd like to easily move them outside the jar, so that it can be modified by others. What would the best approach be here? My initial thought was that I use json formatted files in the jar that kind of show what files that are in directories, but this gets impractical with large amount of files/directories. I'm now thinking, should I use a zip file as an internal resource with all the relevant content, but this gets a bit hard to access when I want to modify this content. What's your opinion on how to proceed?...

Notifications for Android

I am trying to create a java app on android using Maven and VS Code, but cant figure out how to get them to work. All examples on the internet use the Gradle, but i have already been using maven for the project for quite a while. The attempts to use androidx.core core or core-ktx all result in errors for not existing....

How can I reduce the size of fat jar?

I have an application that uses javafx and jsoup, and when exporting the jar file using shadow jar it weighs 8.7 mb, but I think this is too much for a very lightweight application. Is there any way to reduce the size of this file, or any gradle plugins?(preferably for 24 java, but not necessary)...

Game Errors In my game

When i load up my game i made it get 15 errors

JDK install

Which version can I install jdk on Ubuntu 24

Need help with springboot HttpSession data retrieval

Ive been trying for the entire day to figure out as to why ive not been able to retrieve data ive stored in HttpSession mena to be retrieved later when sending a request through another route, in my example, when I logged in and authenticated, I would set a username inside an HttpSession instance in hopes to store it and retrieve it later. When the login was successful and got redirected to the dashboard where it was supposed to say "welcome, <insert user name here>" i ofc work with angular, so I have to send a GET request to retrieve the user from the session, but, the issue lies here : when I logged in, I did save the username inside the spring boot session, but when I sent a GET request after I had logged in, the data was suddenly gone from the session? when I executed session.getAttribute("user") it returned null, when I debugged it mid login and put a SOP there, it showed me that there is now a "user" key inside session, but at any other page, when I call back to spring boot to check the session, suddenly the session's empty....

trying to make executable .jar file

I coded a program in intellij with using maven, made an artifact and build it, and if I run the .jar file which gets created using cmd it works. Now I want to make it executable with a double-click without the need of an additional file, but when I try to run it that way an error message saying "A java Exception has occured." pops up, even tho it works when starting the file using java -jar file.jar in cmd. I also installed jarfix prior to this and run it as admin, it works for other .jar files which I needed it for, but doesn't help with my own program. What am I doing wrong?...
No description

"Expected One argument..."

Hey, I was wondering if I could get some assistance with this. I am coding my first Minecraft plugin, and I was getting this error (shown in screenshot attached) and I was wondering if I could get some assistance for it. Thanks!

i need some help with a minecraft mod

so i have this modid.mixins.json { "required": true, "package": "com.example.mixin", "compatibilityLevel": "JAVA_21",...
No description

can someone send an example for AES-GCM no padding encryption with a random nonce?

can someone send an example for AES-GCM no padding encryption with a random nonce?

Interface

They let me create an interface in Java. I need help with some libraries, please. I have to make the interface import and export documents in Excel. If someone could kindly explain the libraries I need, please...

Connection to localhost:5432 refused when starting spring app

Hello everyone. I have ssh tunnel on my computer, it works fine, i can brose DB etc. in my application.yaml i have this config: ``` spring: datasource: platform: postgres...

Requests are sent in the wrong order or too fast?

hey guys. i have a question with java spring app. right now i have this situation: I have cron job that sends request to the bank (gwService.sendCurrentDayStatementRequest()). this request does a call to /account-statements endpoint. then bank does some stuff, and later i can make requests to get my statement. then im calling gwService.getBankStatementResponse() which calls /message endpoint. and finally i call gwService.deleteBankStatement() which deletes the statement from /messages endpoint. its like a queue type of thing. ```java @Scheduled(cron = "${currentDayStatementCron}") public void sendCurrentDayStatementRequestScheduled(){...

How do you get the value of how much the app uses your CPU?

I am trying to make a CPU usage counter for my Minestom server, but I can't find any simple way to get the servers CPU usage. Does anyone here know how?

List folder files the fastest way

Hi, currently i'm in need of list all the files in a folder with over 20k files (folder will have more files with the time), and then create a csv file with all the folder file names. But i'm kinda stuck since it need to be the fastest way possible, and all the ways i think about, are basically sequential.