Hi,
I am extremely sorry for posting this in the begginners section.
I am a java programmer.
Only thing I have never programmed using JNI.
So I was trying my first program, Helloworld given in the JNI tutorial of the java website,
Here are the steps I have followed:
step 1: Wrote the java program HelloWorld.java
---------------------
class HelloWorld {
public native void displayHelloWorld();
static {
System.loadLibrary("hello");
}
public static void main(
String[] args) {
new HelloWorld().displayHelloWorld();
}
}
----------------
step 2: compile it
javac HelloWorld.java
Step 3: create the .h file
javah -jni HelloWorld
step 4: write impl class
-------------
#include <jni.h>
#include "HelloWorld.h"
#include <stdio.h>
JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)
{
printf("Hello world!\n");
return;
}
--------------
step 5: g++ -Ic:\bea\jdk131\include -Ic:\bea\jdk131\include\win32
-LD HelloWorldImp.c -Fehello.dll
At this point I got parse errors ( not warnings) in the jni.h
So I was wondering if jni.h distributed with certain jdk versions have any bugs or something and if anyone has experienced such a thing before could help me here.
Thank you,
Sony gam