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.