错误 - 在ubuntu中安装JDK 1.8

时间:2014-06-03 18:08:05

标签: java ubuntu java-8

我尝试安装jdk 8,但它仍适用于jdk 7.以下是输出,

sudo update-alternatives --config javac

There is 1 choice for the alternative javac (providing /usr/bin/javac).

  Selection    Path                                 Priority   Status
------------------------------------------------------------
  0            /opt/java-oracle/jdk1.8.0/bin/javac   1         auto mode
* 1            /opt/java-oracle/jdk1.8.0/bin/javac   1         manual mode

sudo update-alternatives --config java

There is 1 choice for the alternative java (providing /usr/bin/java).

  Selection    Path                                Priority   Status
------------------------------------------------------------
  0            /opt/java-oracle/jdk1.8.0/bin/java   1         auto mode
* 1            /opt/java-oracle/jdk1.8.0/bin/java   1         manual mode

javac -version

Error: could not find libjava.so
Error: Could not find Java SE Runtime Environment.

java -version

java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

如果可以,请给我一个帮助。 谢谢:))

1 个答案:

答案 0 :(得分:0)

参考下面的链接,我的工作正常&我在链接上安装了JDK 8.

我认为你错过了javac的更新选择

update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8*/bin/javac 1065

JDK 8 Installation