Java Native Interface 32 bit dll on 64 bit system

前端 未结 6 1636
春和景丽
春和景丽 2020-12-01 10:18
E:\\Code\\Java\\JNITest>java test
Exception in thread \"main\" java.lang.UnsatisfiedLinkError: E:\\Code\\Java\\JNITest\\test.dll: Can\'t load IA 32-bit .dll on a          


        
6条回答
  •  有刺的猬
    2020-12-01 11:20

    1. Download mingw-w64.
    2. Update your Environment variable PATH.
    3. Create a C program named test.c which has implementation for your method.
    4. Run the following cmd in Command prompt

      gcc -Wl,--add-stdcall-alias -I"%JAVA_HOME%\include" -I"%JAVA_HOME%\include\win32" -shared -o test.dll test.c

提交回复
热议问题