无法初始化编译器:未找到编译器镜像中的对象 java.lang.Object [英] Failed to initialize compiler: object java.lang.Object in compiler mirror not found
本文介绍了无法初始化编译器:未找到编译器镜像中的对象 java.lang.Object的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 Ubuntu 16.04 上,我安装了 scala
:
On Ubuntu 16.04, I installed scala
:
$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 时失败:
With openjdk8
installed, scala
fails when opening the 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 8 版本的 OpenJDK 为我解决了这个问题.
Using the Java 8 version of OpenJDK resolved this issue for me.
sudo update-alternatives --config java
sudo update-alternatives --config javac
这篇关于无法初始化编译器:未找到编译器镜像中的对象 java.lang.Object的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文