0

So there's a tool for Eclipse in the Eclipse Marketplace that takes java classes and shows its java byte code. I'm wondering is there a similar tool that does the same for Scala classes?

  • not sure about eclipse but you can always use [`javap -c`](https://stackoverflow.com/a/42816272/432903). `man javap` in terminal will give you the doc for `javap`. Intellij has ["show bytecode"](https://stackoverflow.com/a/16775100/432903) for java, does not seem to work for scala. – prayagupa Nov 12 '18 at 02:56

2 Answers2

1

"java classes" is the same as "Scala classes",they are all standard "java class struct". you can take a look "Java virtual machine specification",so I think you can use "javac -v A.class(A.scala)" to view it's ByteCode and constant pool.there has a better tool "010 Editor" to look java class struct,I usually used it;

hanfei
  • 11
  • 2
0

Yes, there is a tool, called scalap. It takes compiled scala class files (.class files) and almost shows you scala code. It just lacks method bodies.

If you want to view the instructions of a method, you may use javap -c <classfile>. By running javap -v <classfile>, you'll also see the constant pool.

Aki
  • 1,644
  • 12
  • 24