Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala: packages cannot be represented as URI

I have openjdk, scala and sbt, all installed via brew. I'm trying to get setup to work on the scala track on exercism. I'm having no troubles with Java or anything that uses the JVM like clojure, but when I try to test my installation of scala by running the test for the exercism hello example:

$ sbt test 

I get a bunch of errors that seem to start with this:

java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI

My installed versions are as follows:

$ java --version openjdk 13.0.1 2019-10-15 OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.1+9) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.1+9, mixed mode, sharing)  $ scala -version Scala code runner version 2.13.1 --   $ sbt --version sbt version in this project: 1.3.8 sbt script version: 1.3.8  

I've looked and seen this error in a few questions but not seen a way to fix it.

like image 816
0mcg0 Avatar asked Feb 19 '20 19:02

0mcg0


2 Answers

I solved the issue by installing a java version of 1.8 and set JAVA_HOME towards this version.

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home"

like image 139
XWZ Avatar answered Sep 23 '22 21:09

XWZ


I've got the same issue on IntelliJ IDEA and solved it with

Settings > Build, Exec... > Build Tools > sbt > JRE > set to 1.8.

JAVA_HOME has not resolve it in my case

like image 42
pin Avatar answered Sep 24 '22 21:09

pin