Forums Register Login

jni.h incorrect

+Pie Number of slices to send: Send
hi,
I was trying to execute the samples hello world jni program given in the java tutorial.
I have followed all the steps exactly.
I am using the DJGPP c++ compiler ported for windows 2000.
But when I tried to create the .dll file, I encountered parse errors in jni.h file (not my class).
I was wondering if anyone could help me her.
thanks,
Sony gam
+Pie Number of slices to send: Send
Well, I am not going to be able to help with the JNI answers, but if you want someone else to be able to you probably need to show the code that you were parsing, the actual errors that you got, and what os you were working on.
+Pie Number of slices to send: Send
This is a quote from the DJGPP website:
If you ... want to obtain a version of DJGPP that fully works on Windows 2000/XP then please go away as it is not stable enough for a novice or learner to use yet on Windows 2000/XP.
Sounds like you might want to consider using something other than DJGPP if you need to be running Win2000.
+Pie Number of slices to send: Send
Whoa... I found another problem that you're going to have a hard time overcoming... DJGPP is a C++ compiler. You can't compile java programs with a C++ compiler. So, unless I missed something, you probably need to start off by downloading the JDK from Sun's website.
http://java.sun.com/j2se/1.3/
Good luck!
+Pie Number of slices to send: Send
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

Weeds: because mother nature refuses to be your personal bitch. But this tiny ad is willing:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1146 times.
Similar Threads
jni.h not open - can not compile
jni problem
From where can I get 'jni.h' file???
JNI error
JNI Problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:20:04.