Kotlin替代javah [英] Kotlin replacement for javah

查看:599
本文介绍了Kotlin替代javah的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

javah 自JDK 8以来已被弃用在JDK 10中被删除,并根据JEP 313和弃用文本 javac -h 标志:

javah has been deprecated since JDK 8 and will be/has been removed in JDK 10, and according to JEP 313 and the deprecation text, javac with the -h flag should be used instead:


警告: javah 工具计划在下一个主要的JDK版本中删除。该工具已被JDK 8中添加到 javac 的'-h'选项取代。建议用户迁移到使用 javac '-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 files。)

The problem is, javah operates on compiled .class files, while javac operates on source files (i.e. .java files.)

javah 与Kotlin和 外部 功能,因为一切都最终编译为Java字节码,但由于使用Kotlin时没有任何Java源文件,我看不出任何方式 javac -h 可以工作。

javah works fine with Kotlin and external functions, since everything ends up compiled as Java bytecode, but since there aren't any Java source files when using Kotlin, I don't see any way javac -h could work.

Kotlin是否有 javah 替换或解决方法?

Is there a javah replacement, or a workaround, for Kotlin?

推荐答案

我建议 gjavap

将来我还将实现一个更易于使用的命令行工具,该工具提供与javap类似的功能。

I recommend gjavap.
In the future I will also implement an easier-to-use command line tool which provides similar functionality to javap.

这篇关于Kotlin替代javah的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆