Cannot open include file: jni. h: No such file or directory solution

Source: Internet
Author: User

When jni dll is generated, the system prompts that jni. h Cannot be found, and the Cannot open include file: \ 'jni. h \ ': No such file or directory error occurs.

This error occurs when you run the Visual Studio 2008 project.

# Include <stdio. h>

# Include <jni. h>

Int main ()

{

Printf ("Hello World ");

}

But when I try to build, I get the following error-

1> c: testtest. cpp (2): fatal error C1083: Cannot open include file: 'jni. H': No such file or directory

Solution.

To copy the following files to the include folder under the jdk installation directory

The Code is as follows: Copy code

Jdkincludejni. h

Jdkincludewin32jawt_md.h

Jdkincludewin32jni_md.h

The above three files under the jdk installation directory are copied to the include folder under the vc directory. For example, my installation location is:

The Code is as follows: Copy code

D: Program FilesMicrosoft Visual StudioVC98Include

You can determine the installation location.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.