Linux cannot find jni.h and cannot find jni_md.h cause and solution

Source: Internet
Author: User

1. Background

Many friends use the JNI functionality of Java in their daily work.

In the Linux environment, when compiling C files, you may report that you cannot find jni.h, and you cannot find jni_md.h errors.


2. Introduction

First of all, do not suspect that the JDK has an incomplete problem, which will let you go a lot of detours, and finally can not solve the problem.

Take my jdk1.7.0_75 for example, the location of the two header files is:

jni.h jdk1.7.0_75/include

Jni_md.h Jdk1.7.0_75/include/linux


3. The cause of the problem

The #inlcude<jni.h> header file is introduced into the file that will be compiled.

GCC did not find the two header files at compile time and therefore reported the missing hints.


4. SolutionManual introduction of jni.h and Jni_md.h two header files at GCC compile time

Use Gcc-i + header file archive location

Linux cannot find jni.h and cannot find jni_md.h cause and solution

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.