gradle / gradle-native

The home of Gradle's support for natively compiled languages
https://blog.gradle.org/introducing-the-new-cpp-plugins
Apache License 2.0
92 stars 8 forks source link

How to set systemProperty ? #1089

Open harideva16 opened 3 years ago

harideva16 commented 3 years ago

usually I set jni library path like this.

I want to build JPackage for windows , linux and Mac with github actions.

But, I didn't know about how to set system Property in gradle for all the three following os?

How can I set systemProperty java.library.path ?

I followed this answer

I added the following code in gradle.build file to set systemProperty.

task local {
    run {  systemProperty "java.library.path", file("${project(":hello").buildDir}/lib/main/debug").absolutePath }
}

bootRun.mustRunAfter local

But , it not worked.

I followed this project to implement JNI . I searched in internet about how to set system properties for java.library.path in gradle . But , no answer found.

I also asked a question in stackoverflow But , no response.

so, please help me !!!

If I run it comes an error like this java.lang.UnsatisfiedLinkError: no hello in java.library.path.

Can you give any documents or reference about it ?

How can I set systemProperty java.library.path in gradle.build file ?

Give a answer!!!!