Closed ghost closed 3 years ago
The code in the example project would work for doing that. Theres nothing special about a main class thats different from the example.
How to set Native library location in gradle ?
I tried this answer. But , not worked.
Ah, the example does not have that code, and thats generally beyond the scope of this plugin. In essence, you have to make the directory containing your jni library be pointed to by the java.library.path variable. Then the system.load command will load it.
I want to run in Main class.
Can you give an example code ?
I don't really have a standalone example right now on how to do that. I can try to throw one together if I have time in the near future.
How can I run in Main class in this project?
https://github.com/wpilibsuite/gradle-jni/blob/main/example/src/main/java/jnitest/JniFunctions.java
I don't have a sample for that right now. This plugin was designed for building libraries, not applications. It can work for applications, its just not something with current documentation on how to do so.
I am not asking code . I have a doubt about calling native libraries from java with Main class in this plugin.
I think this plugin is waste.
I want to run in Main class like this.
How to use jni libs in Main class ?