Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JNI Version 9 and 10 #209

Open
nedtwigg opened this issue Sep 18, 2021 · 2 comments
Open

JNI Version 9 and 10 #209

nedtwigg opened this issue Sep 18, 2021 · 2 comments

Comments

@nedtwigg
Copy link
Contributor

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

if (hasJsonValue(jsonRoot, "jniVersion", sajson::TYPE_INTEGER)) {
sajson::value jniVersion = getJsonValue(jsonRoot, "jniVersion");
switch (jniVersion.get_integer_value()) {
case 8:args.version = JNI_VERSION_1_8;
break;
default:args.version = JNI_VERSION_1_6;
break;
}
}

#if !defined(JNI_VERSION_1_8)
# define JNI_VERSION_1_8 0x00010008
#endif

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.

@petoncle
Copy link

petoncle commented Oct 8, 2021

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

Which Java version did you need to set it for?

@nedtwigg
Copy link
Contributor Author

nedtwigg commented Oct 8, 2021

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+?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants