Results 1 to 6 of 6

Thread: JNI - Cannot open include file: 'jni_md.h

  1. #1
    Join Date
    Jul 2010
    Posts
    7

    JNI - Cannot open include file: 'jni_md.h

    I have been trying with no avail, to compile my c++ program with the path in visual express cmd, I have tried diff ways but still shows errors. I have searched diff forums but no help so far.

    The following is the code that I am using

    cl -I"c:\program files\java\jdk1.6.0_06\include" -I"c:\program files\java\jdk1.6.0_06\include\win32" -I"." -MT -LD HelloWorld.cpp -FeHelloDLL.dll


    where my path is C:\Program Files\Java\jdk1.6.0_06\include

    If anyone has had this before and solved it please let me know

    Much appreciated

  2. #2
    Join Date
    Dec 2007
    Posts
    2,291

    Re: JNI - Cannot open include file: 'jni_md.h

    if you haven't got it then open up notepad, paste this lot into it and save it as a file called sdkvars.bat in whatever folder you wish to place your command line programs:

    @Set Path=C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\bin;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\vcpackages;%PATH%
    @Set LIB=C:\Program Files\Microsoft Visual Studio 8\VC\lib;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Lib;%LIB%
    @Set INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\include;%INCLUDE%
    @Set NetSamplePath=C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0
    @Set VCBUILD_DEFAULT_CFG=Debug^|Win32
    @Set VCBUILD_DEFAULT_OPTIONS=/useenv
    @echo Setting environment to use Microsoft .NET Framework v2.0 SDK tools.
    @echo For a list of SDK tools, see the 'StartTools.htm' file in the bin folder.
    Now go into the folder and run the .bat file. Hopefully, you'll be able to run csc.exe after you've done this.

  3. #3
    Join Date
    Jul 2010
    Posts
    7

    Re: JNI - Cannot open include file: 'jni_md.h

    thanks for that, the thing is, I have got both the jni.h and jni_md.h files, so I dnt know what is the problem with my compiling method.

  4. #4
    Join Date
    Jun 2006
    Posts
    623

    Re: JNI - Cannot open include file: 'jni_md.h

    Have you tried adding %JAVA_HOME%\include and %JAVA_HOME%\include\win32 in INCLUDE environmental variable.
    so that you can simply type on windows prompt

    cl my.c -Fe my.dll

  5. #5
    Join Date
    Jul 2010
    Posts
    7

    Re: JNI - Cannot open include file: 'jni_md.h

    I have tried it but nothing, I changed the the jni.h to <jni.h> and it workedm but it cant find jni_md.h now

  6. #6
    Join Date
    May 2009
    Posts
    539

    Re: JNI - Cannot open include file: 'jni_md.h

    I had faced a similar issue with my system before when I was working on program. I found a solution at that time and hope this might can help you out. For that in Visual C++ you will need to click on Tools and then in that search for option. Now you have to go in Directories and then add the files in jdk\include AND jdk\include\win. You must add them to the list of directories.

Similar Threads

  1. How do I include one file inside another in HTML?
    By Ekavali in forum Software Development
    Replies: 4
    Last Post: 19-08-2010, 01:38 PM
  2. Which file to include using sleep()?
    By MABON in forum Software Development
    Replies: 5
    Last Post: 19-02-2010, 09:16 PM
  3. How to include the video file in Html
    By Owen Fernandes in forum Software Development
    Replies: 5
    Last Post: 29-12-2009, 11:40 AM
  4. Include a html file by removing head / body
    By KALYAN23 in forum Software Development
    Replies: 3
    Last Post: 09-10-2009, 04:30 PM
  5. include port in hosts file
    By John A Grandy in forum Windows Server Help
    Replies: 2
    Last Post: 15-04-2009, 07:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,047,329.82892 seconds with 17 queries