Java Community | Help. Code. Learn.

JCH

Java Community | Help. Code. Learn.

With more than 20,000 members, join one of the biggest and most active Java Communities on Discord! ☕

Join

java-help

❓︱qotw-answers

Java agent throws UnsupportedClassVersionError when Instrumentation#retransformClasses is called.

I need to dump who invokes a setCancelled(boolean cancelled) method in a running jar (Spigot 1.8). I decided to do this via dumping the caller using StackWalker by using a javaagent to add a method call which dumps the caller, the item field which is of type org.bukkit.inventory.ItemStack, & the cancelled argument. The only issue currently, is that when i call retransformClasses the whole thing comes burning down. Target class: org.bukkit.event.player.PlayerInteractEvent The agent is compiled under Java 17.0.12...

New to Java and Ready to Collaborate!

Hey everyone! I'm just starting to learn Java and excited to dive deeper into it. I'm here to connect, help out on projects, and grow together with others learning Java. Let’s code and support each other along the way!

can someone help me with the hotel management system project

I'm a beginner and my professor never cared to think about something like that, he just does whatever he wants, I really need help with this whole project

Implementing OOP!

Implementing OOP! Hello! I've been learning Java now for about two months and have this personal-finance application that saves data to a csv file and can add transactions, delete, sum by periods, etc, and am currently delving into object-oriented programming! I'm reading about Abstraction, Encapsulation, Innheritance and Polymorphism and am getting it on the technical front. Now, I would like to try and make my code more OOP- if that makes sense. By doing it on a code I'm familiar with I think I will better understand it, but I'm not sure where to start! Would anyone like to review my code and point me in the right direction to start? If I have to do some things over that's okay, originally my code was 400+ lines long but I managed to split it into classes somewhat. What suggestions do you have? Thank you very much! ...

Discord bot code react to image

I saw that there was a tag for Discord bots, and I currently have a dilemma with mine, I would like to implement this code I found on the internet (or a similar one) to my bots script, but that is in JavaScript and I haven't written it myself, though I would like to modify it with a custom command like this one! Is there anyone who is good at Discord bots and could help me out? Shoot me a pm and I can share my code!
No description

Warning when pushing to a new git repo

I'm not sure why I got this warning when I'm trying to set up git and push my folder to GitHub, scared, what does it mean or can I proceed? Also not sure what tag would be appropriate, sorry!...
No description

Need help with fixing bug of ball not moving

Basically I have an assignment and we are using processing to do the assignment as the teacher basically told us to make a game where we have a small red ball moving around the canvas and if it touches the edges then it bounces back away and it if it hits the black ball its supposed to bounce back aswell and respawn a new black ball however I've been having a problem with it. For some reason the ball won't moving across the canvas rather it is just budging itself and even when i press x or y it...

"Encoded password does not look like BCrypt" when trying to enter Swagger.

I was trying to enter Swagger when the Spring Security login page popped up. I tried to log in with username "user" and the password that the console displays but I get a red message that says "wrong credentials" and the message from the title in the console as a WARN.
No description

Karavan & AtlasMap Integration Help

does anybody have camel-karavan & atlasmap experience?

Soap request gives me 404 and "No endpoint mapping" even if everything is correct

Hello everyone. Its been almost a week and I still cant find an error and the reason why I am getting this kind of error. The thing is that my endpoint is correct, everything is set up fine. Earlier this endpoint had different name and everything worked fine. And now after changing the endpoint name everything just broke. Things I tried: asking chat gpt and gemini, asking for help on different discord servers, googling and browsing stackoverflow. The thing is that I cannot change the request body and I just need to use this request body. ...

PostGIS distance calculation gives in-accurate results

```java @Query(value = "SELECT ST_Distance(" + "ST_SetSRID(ST_MakePoint(:userLng, :userLat), 4326), " + "ST_SetSRID(ST_MakePoint(:hotelLng, :hotelLat), 4326)" + ") AS distance", nativeQuery = true)...

How do I reduce Spring Boot's docker image size?

With my current Dockerfile configuration for a barebones spring app (straight from start.spring.io) with dependencies like web, redis, postgres, security, mail sender, etc, the size of the image is at ~350mb and I was told this was pretty large for a barebones application. Here's my dockerfile ```docker...

mcp intellij idea

how to run 1.20.4 in intellij idea
No description

what code I'll write?

Based on this statement what code should I write? this is just a attendance test "Macky is a fourth-year Information Technology student who is an aspirant Cum Laude. During his last term of schooling, he monitors his Midterm Grades taken from the seven subjects which have ratings of 95, 94, 97, 90, 93, 92, and 91. Your task is to create a program that will input Macky's ratings and display the smallest grade that he has. Be sure to use the correct inputs properly to satisfy the given condition." SAMPLE OUTPUT:...

recursion

i don't know how recursion works therefore I need someone to explain what it is, I may understand it that way
No description

Paste functionality in Java

Can you use Java to trigger "ctrl+V" functionality? I have found couple questions asked, 0 answered properly or given no snippets of code. https://stackoverflow.com/questions/6631933/how-would-i-make-a-paste-from-java-using-the-system-clipboard http://www.javapractices.com/topic/TopicAction.do?Id=82 ...
No description