问题
I am using Scala 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_79) on Windows 10.
I did following in REPL
scala> class Book (val title:String)
defined class Book
scala> :javap
:javap [-lcsvp] [path1 path2 ...]
scala> :javap -c Book
Failed: No javap tool available: scala.tools.nsc.interpreter.JavapClass$JavapTool6 failed to initialize.
My PATH environment variable has C:\Program Files\Java\jdk1.7.0_79\bin and JAVA_HOME is set to C:\Program Files\Java\jdk1.7.0_79
I can see the javap.exe in C:\Program Files\Java\jdk1.7.0_79\bin.
Am I missing something?
Thanks.
回答1:
scala> :javap -c Book Failed: No javap tool available: scala.tools.nsc.interpreter.JavapClass$JavapTool6 failed to initialize.
You used JDK 7 but the error message said failed to initialize JavapTool6 not JavapTool7
JavapTool6 and JavapTool7 are different in source: JavapClass.scala
Maybe you activate scala REPL with JDK6
来源:https://stackoverflow.com/questions/39629223/no-javap-tool-not-found-in-scala-repl