We have a legacy Scala project that we need to make changes to and compile on MacOS Catalina. Its summarized config is:
scalaVersion := "2.10.6"
sbt.version=0.12.4
Java 7
At this stage we don't have the resources to upgrade the project to more current versions.
I installed Java 7.
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
I've been trying to install sbt 0.12.4 on MacOS Catalina without success and after several days have exhausted my options.
I've tried installing as per the official manual installation instructions using
sbt-launch.jarbut during installation many of the dependencies are no longer available.I've tried using the sbt-extras script but when running it I get:
Getting net.java.dev.jna jna 3.2.3 ...
:: problems summary ::
:::: WARNINGS
module not found: net.java.dev.jna#jna;3.2.3
==== local: tried
/Users/theuser/.ivy2/local/net.java.dev.jna/jna/3.2.3/ivys/ivy.xml
==== typesafe-ivy-releases: tried
http://repo.typesafe.com/typesafe/ivy-releases/net.java.dev.jna/jna/3.2.3/ivys/ivy.xml
==== Maven Central: tried
http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.2.3/jna-3.2.3.pom
==== sonatype-snapshots: tried
https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna/3.2.3/jna-3.2.3.pom
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: net.java.dev.jna#jna;3.2.3: not found
::::::::::::::::::::::::::::::::::::::::::::::
:::: ERRORS
Server access Error: Connection refused url=http://repo.typesafe.com/typesafe/ivy-releases/net.java.dev.jna/jna/3.2.3/ivys/ivy.xml
SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.2.3/jna-3.2.3.pom
Server access Error: Connection reset url=https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna/3.2.3/jna-3.2.3.pom
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: net.java.dev.jna#jna;3.2.3: not found
Error during sbt execution: Error retrieving required libraries
(see /Users/theuser/.sbt/0.12.4/boot/update.log for complete log)
Error: Could not retrieve jna 3.2.3
We have previously compiled our own cache of dependencies (some of which have become outdated) by manually finding the dependencies which we then place in our ~/.ivy2/cache before compiling. In this case I cannot find jna3.2.3 to include it in /Users/theuser/.ivy2/local/net.java.dev.jna/jna/3.2.3/ as a work-around to see if I can get any further.
- I have copied the
sbt 0.12.4config, folders and ivy cache from another Mac where sbt and the legacy project currently works. Doesn't work.
Any help or clues would be appreciated.
CodePudding user response:
My problem was resolved based on the suggestion of @kmh in the comments and the answer in https://stackoverflow.com/a/29303664/. Thanks!
- Install sbt 0.13 with
brew install [email protected]. It installs Java 8 (openjdk@8) as dependency. - Added
.sbtoptsin root of the project and point it to where Java 7 had been installed:
-java-home
/usr
I then ran sbt and all the dependencies were successfully resolved.
