Java Community | Help. Code. Learn.

JCH

Java Community | Help. Code. Learn.

We are a Community full of Java developers. You can come here to connect other devs, get help, help others and do many more things!

Join

java-help

❓︱qotw-answers

In Project Annotation Proccessor

very short: Some classes are required by my annotation proccessor which when run first compiles the whole project to run which fails because of the classes that its generating missing in some other classes because they are loaded at the same time causing a chikcen egg problem. Running in different sub projects causes either a dependency loop or missing dependencies for some classes with dependencies. full explenation: I recently stumbled across annotation Proccessing and wrote one that works for my purposes as long as its in a different gradle project. However If I want to add something that utilises Classes from my main Code I need to change the location to that other class including that classes dependencies which is quite annoying. However I cant put it in the same project since parts of my code are generated using that annotation Proccessor. That means that the compilation which is needed before the processing fails since the imports to those auto generated classes fail since they are deleted on regeneration. meaning a chicken and egg problem. However the classes that use that generated code are not required by my processor. Meaning I basically would have to only compile the annotation processor first and then the classes as it needs them. After that the rest can be compiled. Question is how could I do that? any other way is also fine by me....

Netbeans not creating a actionperformed section for a certain button?

so, im trying to make a gui trivia application in java and netbeans isn't creating a actionperformed section for my submit button like it did for other buttons, I tried creating it manually biut it did not work, what do I do?

Netty server and javafx services

Hi my server seems to stop without me telling it to 😦 The object of the Server class isn't getting garbage collected but it's channel does get magically stopped...

Unallocating direct buffer

I have a direct buffer that I eventually no longer need and set to null. This however does not free up the memory usage until I perform GC manually. Is there a way to forcefully free that memory automatically when im setting the buffer to null?...
No description

Help what am I missing?

So this is just something I've been doing for boredom and this is the small part of the code, but essentially I'm using MouseMaker for this frog math game ;-; and it's not running and maybe I'm a lil dumb? Is this not right sobbing
No description

got 403 forbidden, can't pass the SecurityFilterChain

So, I am try to hardcoded information on UserDetails to get know how it will pass the authentication by validating if it has "USER" role. but when I try to make request to it I got 403 forbidden.
No description

Spring Boot with Kubernetes Issue

Here is the link : https://github.com/Rapter1990/todowithcouchbase/pull/28 todowithcouchbase -> container "todowithcouchbase" in pod "todowithcouchbase-6c49dcd7f7-jjf2x" is waiting to start: trying and failing to pull image (Here is the image location : https://hub.docker.com/repository/docker/noyandocker/todowithcouchbase/general) Can you help me for my Kubernetes issue ?...
No description

Making an object that can be various types?

I have a byte[] and a short[] used for the same thing. I want to switch from using the byte[] and short[] based on the maximum value needed, which changes occasionally. My idea is to have an Object that is swapped between referencing the byte[] or the short[] as needed. The part I can't figure out is casting the Object to the array type its referencing. I tried this to alter the contents of the array the object is referencing: ```java...

Does anyone know how to solve it?

C:\Users\loots.jdks\corretto-1.8.0_432\bin\java.exe -Dmaven.multiModuleProjectDirectory=C:\Users\loots\Desktop\saprrmrm -Djansi.passthrough=true "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\lib\idea_rt.jar=65213:C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.8.0.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\plugins\maven\lib\maven3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version=2024.3.1 install [INFO] Scanning for projects... Downloading from viaversion-repo: https://repo.viaversion.com/org/github/battlecraft/battlecraft-parent/1.0.0-SNAPSHOT/maven-metadata.xml Downloading from viaversion-repo: https://repo.viaversion.com/org/github/battlecraft/battlecraft-parent/1.0.0-SNAPSHOT/battlecraft-parent-1.0.0-SNAPSHOT.pom [ERROR] [ERROR] Some problems were encountered while processing the POMs:...

Transforming the Springboot Postgres to MySQL having some serious issues.

Thing is I use PostGIS spatial data, here I have to figure it out. The error is confusing, the tables have been created...

java basics help

For this example: ``` public class Animal { public void makeSound (){...

Minecraft plugin that displays text above a player's head

I have the queue, display, and deletion working, the only issue is that there can be multiple ArmorStands/Messages at once, regardless of the fact that I have a Map associating a single armor stand with a player. When the display function is called, it checks if there is an associated armor stand, and deletes it (before i get queue working, i want there to be one message displayed at a time) ``` public final Map<Player, ArmorStand> playerArmorStand = new HashMap<>(); ...

Spring Boot Web page is not loading correctly

In first image, you can see the web page of login once you start the app. In the second image, you can see the correct web page. The HTML, CSS, etc, is made in Bootstrap Studio...
No description

why does a space " " seem to break a if(scanner.next().equals(answers[i])){

how do i make it not break with a two word answer i tested putting in numbers single words and even connecting words using a "-" instead of a space and they all work but as soon as a space goes into the answers[0] = " " it wont continue...

Am I using the wrong loop or the loop wrong

I'm using java 17 and here's my loop the 'for' is there to print out the 'i' question then i want the 'while' loop to let you type out guesses until you get the correct answer...

java: cannot find symbol symbol: method builder()

before you ask, I've already enabled annotation processing in my spring boot project. I don't really know what else I can do

Best Design Approach

So im making an API for a marketplace and i have different kinds of listings (footwear, clothes and accessories) where the enum attributes "subcategory" and "size" would change based on what kind of listing it is, what would be the best design approach for creating these listings? inheritance? factory? Thanks