javah missing after JDK install

midudu picture midudu · May 15, 2018 · Viewed 9.2k times · Source

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.

Answer

Zabuzard picture Zabuzard · May 15, 2018

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.