Created
October 17, 2017 18:30
-
-
Save jbruchanov/4daf6b55ffa08ea4627984e155be5581 to your computer and use it in GitHub Desktop.
JIDEA quick JNI header generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are the IntelliJ IDEA settings I use to generate the .h file: (This applies to IDEA version 12.1.6, probably similar in other versions) | |
File->Settings->External Tools | |
Click the + button for the "Edit Tool" dialog | |
The following are the form name/value pairs I used: | |
Name: javah | |
Group: Java | |
Description: Java Native Interface C Header and Stub File Generator | |
Options: Check All | |
Show in: Check All | |
Tool Settings... | |
Program: $JDKPath$\bin\javah.exe | |
Parameters: -jni -v -d $FileDir$ $FileClass$ | |
Working directory: $SourcepathEntry$ | |
Click OK, Click OK | |
Navigate to your java class with the native method | |
With the java class being shown in the editor, go to Tools->Java->javah | |
Notice the .h file that was generated in the same directory as your class. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment