I've been using JOCL with success to GPU-accelerate my Java algorithms.
It seems I'm unable to include header files (e.g., #include <stdio.h>). So far I've gotten away with coding with just basic stuff but at this point I need to do some Fourier transforms and would like to use a library (FFTW).
I use IntelliJ IDEA as an IDE and a Macbook Pro with Big Sur.
Either use Gluegen + JNI, JNA, JNR or the preview or incubated (depending on your version of Java) Foreign memory access API with or without jextract.
I hope that you know how to use IntelliJ IDEA because we provide almost no guidance about this IDE and anyway, I advise you to understand how to do things without any IDE as this is a tool that should help you to work faster but not something that gets in your way when something doesn't work as expected.