I'm trying to install SBT on a fresh Ubuntu 16.04 machine on AWS. I've never had a problem installing (following instructions) before, but I am now.
I get this error... "The java installation you have is not up to date requires at least version 1.6+, you have version 1.8"
Seems confusing, since 1.8 seems to satisfy the 1.6+ requirement.
references
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 .
Looking at the source of the setup, it is using bc to do the arithmetic check on the java version number and is unable to run bc.
https://github.com/sbt/sbt-launcher-package/blob/320d993fa6a9ad857b65d4cafca6ea9e5d1550b3/src/universal/bin/sbt-launch-lib.bash#L207
You can install bc with apt install bc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With