How to solve “fatal: relocations remain against allocatable but non-writable sections” while using Java native interface?
问题 I'm trying to call a C function inside a Java code. I have this hava code. public class JavaToC { public native void helloC(); static { System.loadLibrary("HelloWorld"); } public static void main(String[] args) { new JavaToC().helloC(); } } . I compiled it and then created header file. Then make the following HelloWorld.c file. #include <stdio.h> #include <jni.h> #include "JavaToC.h" JNIEXPORT void JNICALL Java_JavaToC_helloC(JNIEnv *env, jobject javaobj) { printf("Hello World: From C");