I want to create the head file in IntelliJ IDEA. This is the way I do it:
file>setting>Tools>External Tools
then I click +, specify the title and set the parameters as follow:
Program: C:\Program Files\Java\jdk1.8.0_25\bin
Parameters: -d C:\Users\Administrator\Documents\Visual Studio 2013\Projects\JniExampleLibrary -jni Example.JniExample
Working Directory: C:\Program Files\Java\jdk1.8.0_25\bin
but after clicking ok, there is no JniExample.h file in the path defined above with -d
Would you please tell me what is the problem with it?
Thanks in advance
/usr/lib/jvm/java-6-openjdk-amd64/include/jni. h /usr/lib/jvm/jdk1. 7.
JNI is the Java Native Interface. It defines a way for the bytecode that Android compiles from managed code (written in the Java or Kotlin programming languages) to interact with native code (written in C/C++).
While IntelliJ IDEA is an IDE for Java, it also understands and provides intelligent coding assistance for a large variety of other languages such as SQL, JPQL, HTML, JavaScript, etc., even if the language expression is injected into a String literal in your Java code.
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)
I am using Java 11 (OpenJDK) to compile, so I do not have javah available.
Since now the option to create header files is included in javac, I added it as an compiler option.
(IntelliJ Community 2019.2, other versions should be similar)
Example:
-h C:/Development/Java/YourApp/cpp
I did not have any luck with "-h $FileDir$" or other macro commands of IntelliJ.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With