Android (Java) Learning Note 260:jni Native method header file generation

Source: Internet
Author: User

1. JDK1.6, go to the project's Bin directory under the classes directory:

Use command: Javah packagename.classname

A header file is generated in the current directory, and the JNI protocol method is found from the scratch file

The following example shows:

(1) Enter the "02_ two numbers added" project, as follows:

(2) Enter into the bin/classes directory, as follows:

(3) Type cmd directly in the path bar, then enter as follows:

Enter the bin/classes/directory below the project as follows:

(4) Use command: Javah packagename.classname (CAN), here My computer does not, there is an error, no solution.

2. JDK1.7 (hereafter), enter the project SRC directory:

Use command: Javah packagename.classname

The header file is generated in the current directory, and the JNI protocol method is found from the scratch file

(1) Enter the "02_ two numbers added" project, as follows:

(2) Enter the src/directory, as follows:

(3) use command: Javah packagename.classname

(4) Open this file Com_himi_add_mainacitivity.h, as follows:

Android (Java) Learning Note 260:jni Native method header file generation

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.