No javap tool not found in Scala REPL

时光毁灭记忆、已成空白 提交于 2019-12-11 18:08:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!