Register / Login
Win a copy of
The Way of the Web Tester: A Beginner's Guide to Automating Tests
this week in the
Other JSE/JEE APIs
JNI - DLL Problem
posted 12 years ago
I have written a code in C and I am trying to call it in
I used the free compiler lcc to create a dll:
lcc windowssysteminfo.c -If:\j2sdk1.4.2_03\include -If:\j2sdk1.4.2_03\include\win32
lcclnk -dll "windowssysteminfo.obj" netapi32.lib
I get this error:
Specified export _JNI_OnLoad@8 is not defined
Specified export _JNI_OnUnload@8 is not defined
Missing exports. Aborting
Java forum classifies it as: Bug ID: 4202204
This is what they gave as a solution:
Make JNI_CreateJavaVM, JNI_DefaultJavaVMInitArgs, and JNI_GetCreatedJavaVMs JNIIMPORT instead of JNIEXPORT.
I noticed that the above code is applicable when we call Java in C. What I am trying to do is the opposite.
Any suggestions would be highly appreciated.
native keyword ?
Calling .dll files methods in Java Code
Java --> C++ communication via JNI.
Invoking dll methods from Java