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

Is jdkIncludePath suppose to do something? #35

Closed
kwhat opened this issue Apr 27, 2020 · 4 comments
Closed

Is jdkIncludePath suppose to do something? #35

kwhat opened this issue Apr 27, 2020 · 4 comments

Comments

@kwhat
Copy link

kwhat commented Apr 27, 2020

I am seeing errors like fatal error: jni.h: No such file or directory when trying to use jdkIncludePath in a compile goal. What does this configuration do, and more importantly why doesn't it add an include (-I) to the C src compilation? If this is for something else and I still need to add a <source><directory>${java.home}/include</directory></source> why does it even exist?

@dantran
Copy link
Contributor

dantran commented Apr 27, 2020

@kwhat may want to take a look at this #17

@kwhat
Copy link
Author

kwhat commented Apr 27, 2020

Yah, I was reading that earlier... maintaining backward compatibility is really a lost cause <1.8 || <11. It seems that jdkIncludePath really doesn't do anything meaningful unless you specify <javahOS/>, even when only compiling native src without javah.

@kwhat
Copy link
Author

kwhat commented May 17, 2020

I finally got it working, took a bit of monkeying but it works well, thanks!

@kwhat kwhat closed this as completed May 17, 2020
@gbaudic
Copy link

gbaudic commented Dec 17, 2024

I ran across a similar issue, and I am curious to know which workaround you ended up using.

It turns out that for Java 11 at least (but this likely applies to later versions as well), the default value for jdkIncludePath of ${java.home}/../include that is assumed by this plugin is no longer correct, hence the error. You have to explicitly declare it in your pom as ${java.home}/include.

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

3 participants