public class HelloWorld {
public native void print();
static {
System.loadLibrary("hello");
}
public static void main(String[] args) {
new HelloWorld().print();
}
}
10:30:26: Executing task 'HelloWorld.main()'...
> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes
> Task :HelloWorld.main() FAILED
2 actionable tasks: 2 executed
java.lang.UnsatisfiedLinkError: no hello in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at HelloWorld.<clinit>(HelloWorld.java:5)
Exception in thread "main"
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':HelloWorld.main()'.
> Process 'command 'C:/Program Files/OpenJDK/openjdk-8u292-b10/bin/java.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to
get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
10:30:33: Task execution finished 'HelloWorld.main()'.
My java file
OUTPUT
How can I solve this ?