Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javah missing after JDK install

Tags:

java

javah

I can find java, javac and javadoc but there is no javah.exe in my jdk\\bin folder.

I tried to reinstall the JDK but it is still missing. How can I get it, why is it missing?

I found a similar question where the operating system was Linux but I can not find answers for Windows users.

My OS is Windows 10. The Java version is 10.0.1.

like image 800
midudu Avatar asked May 15 '18 13:05

midudu


2 Answers

The tool javah.exe was removed in Java 10. The reason is simple, it is obsolete. From JEP 313: Remove the Native-header Generation Tool (javah):

Motivation

The tool has been superseded by superior functionality in javac, added in JDK 8 (JDK-7150368). This functionality provides the ability to write native header files at the time that Java source code is compiled, thereby eliminating the need for a separate tool.

Focusing on the support provided by javac eliminates the need to upgrade javah to support recent new paradigms, such as API access via the Compiler API in javax.tools.*, or the new java.util.spi.ToolProvider SPI added in JDK 9.

So you can just use javac.exe if you are on Java 8 or newer.

like image 90
Zabuzard Avatar answered Nov 05 '22 14:11

Zabuzard


javah has been superseded by the -h option added to javac in JDK 8.

It is deprecated since Java 9.

See here for details.

like image 43
Ahmad Shahwan Avatar answered Nov 05 '22 14:11

Ahmad Shahwan