I looking for a way to inspect the generated bytecode which easily integrates into either SBT or the Eclipse Scala IDE.
I guess the default approach would be to:
console
in SBT :javap -c ClassToAnalyze
However, I'm working on JVM version 1.7 (Scala version 2.10.0) and I simply get:
:javap not yet working with java 1.7
Are there any alternatives to inspect/analyze the generated bytecode?
Both the following work for me with java 1.7
:javap
in the Scala 2.11 REPL javap
tool of the Java 1.7 JDK Now, to integrate that with SBT or Eclipse, you could make use of the JDK's javap
in the same way as any other executable compatible with the command-line.
EDIT running external commands is not cross-platform of course, but in the case of SBT "scripts" you can refer to:
A couple of years ago I put together a simple sbt plugin that dumps the output of the ASM textifier to disk for a whole project, which you might find more convenient than javap.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.