LabyMod / opus-jni

Simple Java Opus library
GNU General Public License v3.0
37 stars 10 forks source link

Can't compile on Linux #6

Open stefan-reich opened 3 years ago

stefan-reich commented 3 years ago

Hi, is it possible that opus-jni is meant for a very old JDK? I am trying to build it with JDK 16.

First, I had to do a workaround because javah has been retired long ago (it's now javac -h).

Then I get this error:

> Task :opus-jni-java:generateJniHeaders FAILED
[JNI | GEN | ERR] error: Class names, 'net.labymod.opus.OpusCodec', are only accepted if annotation processing is explicitly requested
[JNI | GEN | ERR] 1 error

Greetings

jan-br commented 3 years ago

Hi, yes this is quite an old project. And it was meant to be compatible with JDK 8. This library was built under quite a bit of time pressure. So it is not really designed to be that future-proof.

I assume there are third party gradle plugins out there that can replace the java header file generation with JDK version safety. If I find the time for it, I might look into it. But for a quick fix you could just replace the javah command in your local repository of the project. The error you sent in should also be easy to fix. Try to replace in the generateJniHeaders task net.labymod.opus.OpusCodec with net.labymod.opus.OpusCodec.java.

Also, If you have the time for it, you could also prepare a PR to fix the whole thing more neatly. :)