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

Need help obfuscating project

Im making a Minecraft 1.8.9 Forge mod and want to obfuscate my project with ProGuard. I linked my gradle build file and my proguard rules file. Error im getting while building:
Can't find common super class of [InstallerFrame] (with 1 known super classes: InstallerFrame and 1 unknown classes: javax.swing.JFrame) and [java.lang.Exception] (with 3 known super classes: java.lang.Throwable, java.lang.Object, java.lang.Exception)
Can't find common super class of [InstallerFrame] (with 1 known super classes: InstallerFrame and 1 unknown classes: javax.swing.JFrame) and [java.lang.Exception] (with 3 known super classes: java.lang.Throwable, java.lang.Object, java.lang.Exception)
...

AVL trees

I have a error in a Java AVL tree implementation. I'm not finding the error, its should be something about restructuring of the tree. Any help would be appreciated.

unable to locate png from location on pc

``` try { image = ImageIO.read(new File("C:\Users\mikso\IdeaProjects\UPT\src\main\resources\draggg.png")); } catch (IOException e) { e.printStackTrace();...

Unable to catch MethodArgumentTypeMismatchException on doFilter()

I have a filter that basically logs incoming and outgoing information, but it seems that using this custom RequestLoggingFilter implements Filter creates a problem, I get MethodArgumentTypeMismatchException when a request's URI is unmapped. Error as follows: ``` org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Long'; For input string: "all"...

Adding character/s to a string has two different variations.

If you add two characters to a string you get an int as an output but when you add one character it works. Please explain. Here is an example with output for reference. ```java String str = "eeksforGeeks"; ...

My code will only return the perameter

In my unacceptable date method, i have code so far that finds if the year of a date are integers. It works when allowing the user to reenter the date, but the reentered date doesnt go into my txtfile, the original date does. I have used ab24-08-24 to show the incorrect date going into the text file. I return the date outside of a for loop and it returns the first incorrect date written which is the perameter.

Testing Framework in Java

* Hi Team, What is the recommended testing framework or the most use testing framework for testing Java applications?...

#StartSETUP

Greetings. I admit I'm starting to learn what I can learn. And now I'm trying to learn About JPA. After I generate with JPA, SpringBoot Devtool, and also Posters SQL dependency, I want to connect to my database. But, for 3 days I've stick with this same error:...

Game Logic

Hello everyone, I've build a program that simulates a scenario where three numbers are input by the user, and the program calculates the waiting time and movement between three cells for optimal and fastest time to get to the end. But now I am stuck. Why does it output "31" when you put 5 in zahl1, 8 in zahl2 and 21 in zahl3 when it should say 24 since that would be the most optimal path?...
No description

Jackson Mapper - String[] conversion possible?

This should be trivial, but I cannot figure out how to do it. In looking at custom annotations and additional registered serializers, I must be missing something. `import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.impl.StringArraySerializer; ...

Error Handling with try and while

Hi guys 'm a total newbee, when I call this function it just prints "Input cannot be empty. Please enter a valid string." forever and disallow me to enter anything after first attempt, How do I correctly incorporate error handling here? """...

Guys, is there anyone here who can help me find the spawnrate of structures in a Minecraft .jar file

I need help finding the spawn rate of structures in a Minecraft .jar file I decompiled, but is obfuscated, for my IB Internal Assessment.

How to find generics when running a java process

I'm generating code out of code. To do this I need to scan code to generate the code, this includes generics. Currently I'm using classgraph as the scanner for the code, but it does not look like it supports generics (I believe it's runtime, so generics don't exist there). Does anyone know a way to programmatically fetch generics from a library?...

OpenAI API

How would you recommend working with the OpenAI API in a Java Project? - Java Version is 1.8...

Java Swing window not showing

I have uploaded 2 .java files one is ShapedWindow and second Window. When running ShapedWindow the window appears as expected and UI works. ShapedWindow is basically few copypasted snippets together, so I wanted to rewrite it with Anonymous class overriding JPanel as seen in Window class but when running that, GUI does not show up, as if the call to display does not happen. Since biggest change was the Anonymous class I would be looking for issue there but I am not sure what exactly I am looking for. Is there a way of doing this better?...

AWT window coordinate system

What coordinate system does awt use when you set a size of a frame? Does it use screen- or pixel coordinates? Because if I create a window of the same content size with glfw the glfw window is smaller. And yes I know that awt includes the decorations in the size of the window https://cdn.discordapp.com/attachments/680222311097303072/1305880569082806313/image.png?ex=6734a38d&is=6733520d&hm=08f1b2a5237f61e2a61bd2dedabd6d23350f0ee0d27de648e6f533e2d8f33ffc&...

How do I keep a class available to unload while keeping a MethodHandles.Lookup of it?

I have a library where a class can consent to full access of private members by registering its MethodHandles.lookup() in its static initializer. Something like this: ```JAVA class Foo extends Thing{ static{ accessConsent(MethodHandles.lookup()); } ...

Removing roll from camera matrix

I have a camera class which is just this: ```java import org.joml.*; public class Camera {...

Deploying my java app to VPS with Github actions and Dockerization

This is the deployment code I got from our existing project ```yml name: build and deploy movie app service backend
...