opus-jni icon indicating copy to clipboard operation
opus-jni copied to clipboard

Can't compile on Linux

Open stefan-reich opened this issue 3 years ago • 1 comments

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

stefan-reich avatar Oct 08 '21 16:10 stefan-reich

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. :)

jan-br avatar Oct 10 '21 13:10 jan-br