Igor De Souza wrote:you might have to consider this:
https://pi4j.com/pi4j-os/
it could help a lot to start.
It's worth noting that as a general rule, talking to non-traditional I/O devices in Java fails because Java's "write once/run anywhere" policy doesn't allow Java code to talk directly to memory-mapped I/O, I/O ports, or interrup service routines. The Pi4J distro, however, includes a set of JNI classes specifically aimed at getting around that.
It would be interesting to know if Pi4J-OS is capable of being ported to the "Pi clone" SBCs such as Orange Pi or BeagleBone. I had to port a project from Pi to BeagleBone during the Great Pi Shortage because at the time there was no shortage of BeagleBone Black units and they were adequate to the task. And it wasn't difficult. But that was C code, not Java.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.