packr icon indicating copy to clipboard operation
packr copied to clipboard

JNI Version 9 and 10

Open nedtwigg opened this issue 4 years ago • 2 comments

It appears that packr currently supports only JNI Version 6 and 8

https://github.com/libgdx/packr/blob/9c9bb9d050524eec58acddfca85e606fbab31637/PackrLauncher/src/main/cpp/packr.cpp#L582-L590

https://github.com/libgdx/packr/blob/9c9bb9d050524eec58acddfca85e606fbab31637/PackrLauncher/src/main/headers/packr.h#L23-L25

But there are now two newer versions (link). JNI_VERSION_10 is used for Java 10 through to at least 17.

#define JNI_VERSION_9   0x00090000
#define JNI_VERSION_10  0x000a0000

I haven't encountered any problems with this so far, but I know that I did need to set "jniVersion": 8 in my config.json. For people upgrading to newer JVMs, if you are encountering issues with JNI, you might want to investigate here.

nedtwigg avatar Sep 18 '21 18:09 nedtwigg

I did need to set "jniVersion": 8 in my config.json

Which Java version did you need to set it for?

petoncle avatar Oct 08 '21 09:10 petoncle

I originally needed to set it for Oracle JRE 8, and I am now using that same flag for AdoptOpenJdk 11, and it is working fine. I think most of my dependencies so far are still compiled to run against JRE 8, but I'm not sure. Perhaps the trouble won't come until those dependencies start requiring/compiling-against Java 11+?

nedtwigg avatar Oct 08 '21 23:10 nedtwigg