java jni 签名,为嵌套类的方法获取JNI签名

Lets say I have a class called Scope that has a nested class called Variable, how exactly do I use javap -s to get the JNI signatures of the classes inside? I've tried doing

javap -classpath -s Scope$Variable

, but this does not seem to work. It seems to just get me the same information as if I only typed "Scope" rather than "Scope$Variable".

Thanks for any help

解决方案

If you are running javap in a Linux/Unix environment, then the $ will be interpreted by the shell and not by javap. Therefore it mus be escaped. Simplest solution would be:

javap -classpath -s 'Scope$Variable'

Without the quotes the shell (I assume a *sh offspring) will try to substitute the $Variable part with the contents of the environment variable Variable. I assume that no such variable exists and there fore nothing (as in "empty string") is substituted. Hence javap sees only

javap -classpath -s Scope

If you are running the command from Windows, then this is not an issue, because the magical character would be %.

BTW: I don't know why JNI is involved here.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值