java - Kotlin 替代 javah

标签 java kotlin java-native-interface

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 to javac in JDK 8. Users are recommended to migrate to using the javac '-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/

相关文章:

java - Spring JPA 存储库不返回实体列表

android - 如何为 Hilt Android 提供上下文?

android - 如何诊断 Xamarin Android 弱引用表溢出的原因?

java - 无法在 OSX 上启动 Eclipse(版本不适合)

java - 将截击结果返回到不同的类(class)

android - 使用首选项时不能将整数转换为 bool 值

java - 如何使用 jni 将数据从 java InputStream 移动到 C++ 中的 char *?

java - Linux 上 C 与 Java 的接口(interface)

java - 从字符串中的byte[]到字符串?

kotlin - 如何修复 Guice 错误, "An illegal reflective access operation has occurred"