javah
has been deprecated since JDK 8 and will be/has been removed in JDK 10 ,并且根据 JEP 313 和弃用文本,应使用带有 -h
标志的 javac
代替:
Warning: The
javah
tool is planned to be removed in the next major JDK release. The tool has been superseded by the '-h' option added tojavac
in JDK 8. Users are recommended to migrate to using thejavac
'-h' option; see the javac man page for more information.
问题是,javah
对编译后的 .class
文件进行操作,而 javac
对源文件(即 .java
文件。)
javah
可以在 Kotlin 和 external
上正常工作函数,因为一切最终都编译为 Java 字节码,但是由于在使用 Kotlin 时没有任何 Java 源文件,我看不到任何 javac -h
可以工作。
Kotlin 是否有 javah
替代品或解决方法?
最佳答案
我推荐gjavap .
future 我还将实现一个更易于使用的命令行工具,它提供与 javap 类似的功能。
关于java - Kotlin 替代 javah,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48816188/