在Ubuntu 16.04,我裝scala
:無法初始化編譯器:在編譯器鏡對象java.lang.Object中未找到
$ls ~/Binary/scala-2.11.8
bin doc lib man
$grep -A 2 SCALA ~/.bashrc
SCALA=~/Binary/scala-2.11.8
SBT=~/Binary/sbt
export PATH=$PATH:$SCALA/bin:$SBT/bin
在安裝openjdk8
,scala
打開REPL時失敗:
$javac -version
javac 1.8.0_91
$
$scala
Welcome to Scala 2.11.8 (OpenJDK 64-Bit Server VM, Java 9-internal).
Type in expressions for evaluation. Or try :help.
scala>
Failed to initialize compiler: object java.lang.Object in compiler mirror not found.
** Note that as of 2.8 scala does not assume use of the java classpath.
** For the old behavior pass -usejavacp to scala, or if using a Settings
** object programmatically, settings.usejavacp.value = true.
Failed to initialize compiler: object java.lang.Object in compiler mirror not found.
** Note that as of 2.8 scala does not assume use of the java classpath.
** For the old behavior pass -usejavacp to scala, or if using a Settings
** object programmatically, settings.usejavacp.value = true.
我該如何解決它?
JAVA_HOME在您的機器中的價值是什麼? –
沒有設置。但是,我使用'sudo update-alternatives --config javac'來修復它,以使用openjdk-8而不是'/ usr/lib/jvm/java-9-openjdk-amd64/bin/java'。 –
設置JAVA_HOME是否擦除錯誤? –