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!
JoinJCH
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!
JoinHow 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
...
...
How do I write a unit test for an in order traversal of a binary tree
``` Java
public void inOrder(){
InOrderTraverse(root);
}
...
Project obfuscation
Hey Im trying to obfuscate my jar file with proguard, but Im having trouble doing so
```
-dontoptimize
-dontpreverify
-keep class ** { *; }...
Creating a gradle plugin for a custom JVM language
Hi!
I'm currently struggling making a gradle plugin for a simple JVM language I've made.
The goal is to make my language buildable using gradle with the least user configuration as possible.
I already read this article on sorcersoft, this one on baeldung and this one from dzone.
I also read the official gradle documentation....
Bypass SQLRestriction to achieve SoftDelete with "hard delete"
I have this entity:
```java
@Entity
@SQLRestriction("deleted = false")
@Getter...
Compiling manually via CMD
I'm doing a Java course where they are making me manually compile, however it seems to not be working. Have I done something wrong? Any way to fix this?

Populate Spring Data JPA before each @Test
I want to test my Products repository (or other tests that requires database to be populated first). I have tried using
ApplicationListener<ApplicationReadyEvent> previously but even though (in the testing environment), the populating methods seem to have been run, the .save methods called by them returns null for each data creation when populating.
My goal is to have the database bootstrapped with the data I have parsed from my CSV parser so it can be used as a Test resource. I have tried so many things, but yet none of them automatic populators work, for it to work, I have to manually populate the data explicitly before tests in the test environment.
The DataJpaTest:...Best modern resources for new Sprint Boot project
Can anyone share their favorite resources on:
1. adding integration tests and setting up tests/mocks for a new Spring Boot 3 project
2. Understand more and any changes around spring context
3. Any new logging features/recss...
help with opening an Http server with java
I am currently opening an http server in an xml file I'm using version 2.17.2 arch type: maven-archetype-quickstart,
and when I'm writing "import com.fasterxml.jackson.databind.ObjectMapper;" it responds by error "Cannot resolve symbol 'fasterxml'"
can someone help?...

