Vidhi Goel

Greenhorn
+ Follow
since Feb 23, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vidhi Goel

Hi All,

I would like to summarize the steps followed to run the JNI code:

1. Wrote a Java program named "HelloWorld.java" in eclipse:




2. Using External Tools Configurations, tried creating a Header file for the above class. The system generated header file:



3. Wrote the C implementation of the HelloWorld class as:




I am using Netbeans 6.8 IDE to create the C Source file.
Compiler: Cygwin (gcc 3.4.4)

When I compile the above code, I am getting a no. of errors in <jni.h>

The output window of Netbeans looks something like this:

MS-DOS style path detected: C:\Program Files\Java\jdk1.5.0_11\include\jni.h.gch
Preferred POSIX equivalent is: /cygdrive/c/Program Files/Java/jdk1.5.0_11/include/jni.h.gch
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
from HelloWorld.c:2:
In file included from HelloWorld.h:8,
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:169: error: conflicting types for 'JNINativeMethod'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:169: error: previous declaration of 'JNINativeMethod' was here
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:182: error: redefinition of typedef 'JNIEnv'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:182: error: previous declaration of 'JNIEnv' was here
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:196: error: redefinition of typedef 'JavaVM'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:196: error: previous declaration of 'JavaVM' was here
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:199: error: redefinition of `struct JNINativeInterface_'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:762: error: redefinition of `struct JNIEnv_'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1840: error: redefinition of `struct JavaVMOption'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1843: error: redefinition of typedef 'JavaVMOption'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1843: error: previous declaration of 'JavaVMOption' was here
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1845: error: redefinition of `struct JavaVMInitArgs'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1851: error: redefinition of typedef 'JavaVMInitArgs'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1851: error: previous declaration of 'JavaVMInitArgs' was here
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1853: error: redefinition of `struct JavaVMAttachArgs'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1858: error: redefinition of typedef 'JavaVMAttachArgs'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1858: error: previous declaration of 'JavaVMAttachArgs' was here
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1862: error: redefinition of `struct JDK1_1InitArgs'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1884: error: redefinition of typedef 'JDK1_1InitArgs'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1884: error: previous declaration of 'JDK1_1InitArgs' was here
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1886: error: redefinition of `struct JDK1_1AttachArgs'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1888: error: redefinition of typedef 'JDK1_1AttachArgs'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1888: error: previous declaration of 'JDK1_1AttachArgs' was here
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1895: error: redefinition of `struct JNIInvokeInterface_'
C:\Program Files\Java\jdk1.5.0_11\include\jni.h:1911: error: redefinition of `struct JavaVM_'
make: * [build/Debug/Cygwin-Windows/HelloWorld.o] Error 1
BUILD FAILED (exit value 2, total time: 1s)



I dont think so that any change in jni.h is needed. Its something which compiler is not understanding. Don't know what.

Please help.
14 years ago
Hi ,

I am also facing the same problem as mentioned. I want to open a new window by appending a paramID to the URL.
From the given code snippet, I did not understand what should I put in place of bean name in the following snippet:
<bean:write name="bean name " property="postID">

Please help.
14 years ago