我正在尝试在AWS上的全新Ubuntu 16.04机器上安装SBT。以前我按照说明安装从未遇到问题,但现在出现了问题。
我收到以下错误信息... "您的java安装程序已经过时,需要至少1.6+版本,您的版本为1.8"。
看起来很困惑,因为1.8似乎满足1.6+的要求。
参考资料:
scala - https://www.scala-lang.org/documentation/getting-started-sbt-track/getting-started-with-scala-and-sbt-on-the-command-line.html sbt - http://www.scala-sbt.org/1.0/docs/Installing-sbt-on-Linux.html
我收到以下错误信息... "您的java安装程序已经过时,需要至少1.6+版本,您的版本为1.8"。
看起来很困惑,因为1.8似乎满足1.6+的要求。
参考资料:
scala - https://www.scala-lang.org/documentation/getting-started-sbt-track/getting-started-with-scala-and-sbt-on-the-command-line.html sbt - http://www.scala-sbt.org/1.0/docs/Installing-sbt-on-Linux.html
sudo apt-get update
java -version
# The program 'java' can be found in the following packages:
# * default-jre
# * gcj-5-jre-headless
# * openjdk-8-jre-headless
# * gcj-4.8-jre-headless
# * gcj-4.9-jre-headless
# * openjdk-9-jre-headless
# Try: sudo apt install <selected package>
sudo apt-get install openjdk-8-jdk -y
java -version
# openjdk version "1.8.0_151"
# OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
# OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt
sbt
# /usr/share/sbt/bin/sbt-launch-lib.bash: line 207: bc: command not found
# The java installation you have is not up to date
# requires at least version 1.6+, you have
# version 1.8
# Please go to http://www.java.com/getjava/ and download
# a valid Java Runtime and install before running .
bc
命令:"bc: command not found"。这可能只是脚本逻辑错误的错误假设,导致了失败与Java版本有关。 - virullius