• Post Reply Bookmark Topic Watch Topic
  • New Topic

"jni_md.h: No such file or directory"- Error Message while compiling C source code

 
Mohamed Sanaulla
Bartender
Posts: 3166
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I created a HelloWorld.java file then used javap -h to create HelloWorld.h. Included this header file and jni.h in the C source code. I am using Cygwin on Windows XP. I copied the header files in JAVA_HOME\include directory to usr\include directory of the Cygwin installation on Windows. After doing all this when i try to compile using gcc HelloWorld.c i get a huge list of error messages the first one being "" I guess the other messages might be due to this one.

My HelloWorld.c Source:



I tired to google with the error message but could not get much help. Also i am using Cygwin with JDK 1.6 U13

Thanks
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also include JAVA_HOME/include/linux (I think this is the one; I'm on Windows where it's called win32).
 
Mohamed Sanaulla
Bartender
Posts: 3166
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also include JAVA_HOME/include/linux (I think this is the one; I'm on Windows where it's called win32).


Oh i forgot to mention that- I did copy the header files from the JAVA_HOME\include\win32. I also tried using gcc with -I option specifying both the include fields- JAVA_HOME\include and JAVA_HOME\include\win32. Earlier i used to get jni.h not found but after copying both the directories i get the message jni_md.h not found.
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you keep the jni_md.h in the win32 folder? Because if you're using them directly in your application path, you shouldn't - jni.h includes which means the same folder as you currently are.
 
Mohamed Sanaulla
Bartender
Posts: 3166
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you keep the jni_md.h in the win32 folder? Because if you're using them directly in your application path, you shouldn't - jni.h includes


I tried copying the jni_md.h file to the same folder where jni.h is available. This time its showing the following error messages:



After this there's a long list of errors stating parse error before '*' token
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's Try changing that to Cygwin probably doesn't know the __int64. Also check out http://www.graphics-muse.org/wp/?page_id=147
 
Mohamed Sanaulla
Bartender
Posts: 3166
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot. I am able to create the object code and then the DLL now.

But there's a different problem now. when i run java HelloWorld (the name of the java class is HelloWorld) the command line cursor keeps blinking but there's no output. It does not execute and keeps waiting for the output. Any hints on this?

Regards,
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!