getting sbt : Depends: java6-runtime-headless while trying to install SBT - scala

Hi I am trying to install sbt.
I have Oracle Java installed (not openJDK):
java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
But when I try to install SBT I am getting this:
sudo apt-get install sbt
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
sbt : Depends: java6-runtime-headless
Recommends: git
scala : Depends: java6-runtime-headless
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
EDIT:
got the same response when using
apt-get -f install sbt

The error message says:
apt-get -f install
'f' means 'fix broken', because something wrong with your current package repo
'apt-get -f install sbt' is wrong!

I'd recommend skipping the .deb install of sbt and scala and just installing sbt manually as per http://www.scala-sbt.org/0.13/tutorial/Manual-Installation.html
Then for interactive scala play, just use ./sbt console
This makes it easy to play with different versions of scala by simply having directories with different sbt project files.

I had remove scala
and then install java8 installer following this instructions

Related

How to install sbt 0.13.15 with oracle jdk

while installing sbt 0.13.15, it fails because it asks for openjdk-8. But I am running oracle jdk 8 and want to run sbt with it. How can I do this?
This error is shown
sbt depends on openjdk-8-jdk; however:
Package openjdk-8-jdk is not installed.
dpkg: error processing package sbt (--install):
dependency problems - leaving unconfigured

sbt is installed but not found

Fedora 25. sbt is installed and I have been using it, probably last time was a week ago. But today it is not found.
$ sbt
bash: sbt: command not found...
Install package 'sbt' to provide command 'sbt'? [N/y]
Tried a reinstall but dnf knows what I do
$ sudo dnf install sbt
[sudo] password for xxx:
Last metadata expiration check: 0:31:12 ago on Thu Apr 27 19:39:34 2017.
Package sbt-0.13.15.2-2.noarch is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
Checked for install location with which but no luck
$ which sbt
/usr/bin/which: no sbt in (/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/xxx/.local/bin:/home/xxx/bin)
I would guess the problem is in my $PATH however I have not altered it, although I have installed some packages
$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/xxx/.local/bin:/home/xxx/bin
Finally i did find a jar named sbt-launch.jar in /usr/share/sbt/bin/ but I don't think /usr/share has ever been part of my $PATH.
Recommendations? thx
fixed it by running
$dnf reinstall sbt
Out of curiosity I checked $PATH again afterwards and it was the same. So it was something else evidently.
I have resolved it reinstalling:
First, uninstall sbt:
yum remove sbt
Then download the version you want from https://dl.bintray.com/sbt/debian/
wget http://dl.bintray.com/sbt/rpm/sbt-0.13.16.rpm
And install by yum
sudo yum install sbt-0.13.16.rpm
Check it with sbt about
sbt about
It must show you similar to
sbt about
[info] This is sbt 0.13.16
[info] sbt, sbt plugins, and build definitions are using Scala 2.10.6

How to install older version of sbt?

I am facing some "UNRESOLVED DEPENDENCIES" problem for my custom dependencies with latest version of sbt(0.13.8)
I want to install older version of sbt, Do we have any command by which I can install older version of sbt ?
You can define the sbt version by writing the one you need in /project/build.properties
It would be something like:
sbt.version=x.xx.x
Use the following command for a Debian-based Linux:
sudo apt-get install sbt=0.13.13

libjansi issue when trying to install Scala on Ubuntu 10.04

when i do
apt-get install scala
The following packages have unmet dependencies. scala: Depends:
libjansi-java but it is not installable E: Broken packages
Though when I do apt-cache show scala I get
Architecture: all Version: 2.7.7.dfsg-4ubuntu1 Depends: scala-library
(= 2.7.7.dfsg-4ubuntu1), openjdk-6-jre | java6-runtime Filename:
pool/universe/s/scala/scala_2.7.7.dfsg-4ubuntu1_all.deb
That seems a very very old Scala included in the default repository.
Follow these instructions to install the Typesafe Stack with all the goodies. This is the official distribution of Scala and related tools.
You could try:
sudo apt-get -f install
without any package names
scala : Depends: libjansi-java but it is not installed
If you recently installed Scala and Java Background Processing is running wait for some time 10-20 mints and use
sudo apt-get update
and after this time interval you can try to install whatever you wanted this dependency issue resolve automatically. its works

Installing Eclipse with ant1.8 on Ubuntu 10.04 through package manager

I'm having trouble figuring out a way to have both Eclipse and ant1.8 installed through the package manager on Ubuntu 10.04.
With ant1.8 installed, trying to install eclipse yields:
The following packages have unmet dependencies:
eclipse: Depends: eclipse-jdt but it is not going to be installed
Depends: eclipse-pde but it is not going to be installed
E: Broken packages
Going down the dependency tree, I arrive at:
The following packages have unmet dependencies:
eclipse-platform: Depends: ant (>= 1.7.1)
E: Broken packages
But, installing ant requires the removal of ant1.8.
Is there a way to resolve this issue without installing ant1.8 or or eclipse outside of the package manager?
Thanks!
Do you have any reason to keep ant 1.8? If not, remove it first and then try the same again after you install ant 1.7.1.
I personally never install any java development tools from repository, because it gives you all kind of problems, such as version incompatibility, difficulties to upgrade etc. Most of the java tools, IDEs, app servers are available for download in zip archives, so you just have to unzip it, set up environment variables and you're ready to go!