コンパイラの初期化に失敗しました: コンパイラミラー内のオブジェクト java.lang.Object が見つかりません 質問する

コンパイラの初期化に失敗しました: コンパイラミラー内のオブジェクト java.lang.Object が見つかりません 質問する

Ubuntu 16.04 では以下をインストールしました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

インストールするとopenjdk8scalaREPL を開くときに失敗します。

$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.

どうすれば解決できますか?

ベストアンサー1

OpenJDK の Java 8 バージョンを使用することで、この問題は解決しました。

sudo update-alternatives --config java
sudo update-alternatives --config javac

おすすめ記事