alexarchambault on v2.1.0-M6-28-gbad85693f
@vijayemmanuel did you figure this out? Unfortuantely, I have no idea how to determine what my cs/coursier version is.
:point_up: January 8, 2022 8:36 PM
I can successfully run
fetch, but not
:wave: I'm new to Scala (started today) and I'm trying to understand how Coursier fit into everything. Would anyone mind explaining a bit? I installed it on my M1 MBP (But I still it runs under Rosetta since it doesn't support Apple Sillicon?) and it required me to have OpenJDK installed. Once installed, I run
cs setup and it installs yet another JDK, including some tools like
scalafmt. I'm trying to follow the Functional Programming Principles in Scala course on Coursera but ran into problem when they asked me to run
sbt in the example project. Instead of starting the
sbt prompt I got the following error:
~/code/scala-course $ sbt [info] [launcher] getting org.scala-sbt sbt 1.5.0 (this may take some time)... java.lang.ClassCastException: class java.lang.UnsupportedOperationException cannot be cast to class xsbti.FullReload (java.lang.UnsupportedOperationException is in module java.base of loader 'bootstrap'; xsbti.FullReload is in unnamed module of loader 'app') at sbt.internal.XMainConfiguration.run(XMainConfiguration.java:59) at sbt.xMain.run(Main.scala:46) at xsbt.boot.Launch$.$anonfun$run$1(Launch.scala:149) at xsbt.boot.Launch$.withContextLoader(Launch.scala:176) at xsbt.boot.Launch$.run(Launch.scala:149) at xsbt.boot.Launch$.$anonfun$apply$1(Launch.scala:44) at xsbt.boot.Launch$.launch(Launch.scala:159) at xsbt.boot.Launch$.apply(Launch.scala:44) at xsbt.boot.Launch$.apply(Launch.scala:21) at xsbt.boot.Boot$.runImpl(Boot.scala:78) at xsbt.boot.Boot$.run(Boot.scala:73) at xsbt.boot.Boot$.main(Boot.scala:21) at xsbt.boot.Boot.main(Boot.scala) [error] [launcher] error during sbt launcher: java.lang.ClassCastException: class java.lang.UnsupportedOperationException cannot be cast to class xsbti.FullReload (java.lang.UnsupportedOperationException is in module java.base of loader 'bootstrap'; xsbti.FullReload is in unnamed module of loader 'app')
After some debugging on my part, it looks like Coursier installed
1.6.2 and the project had configured
sbt.version=1.5.0. Changing this to
sbt.version=1.6.2 instead, solved the problem.
.bash_profilefor a vert specific JDK.
@Flowdalic When I run
cs setup it asks to put things into
.bash_profile. Specifically the following:
# >>> JVM installed by coursier >>> export JAVA_HOME="/Users/kevin/Library/Caches/Coursier/arc/https/github.com/adoptium/temurin18-binaries/releases/download/jdk-18%252B36/OpenJDK18U-jdk_x64_mac_hotspot_18_36.tar.gz/jdk-18+36/Contents/Home" # <<< JVM installed by coursier <<< # >>> coursier install directory >>> export PATH="$PATH:/Users/kevin/Library/Application Support/Coursier/bin" # <<< coursier install directory <<<
/Users/kevin/Library/Application Support/Coursier/bin to my
PATH is fine, but the
JAVA_HOME is explicit. If I'm supposed to use Coursier to manage different versions of the JVM, I don't see how this fits into that.
cs java --jvm 11 --env
JAVA_HOMEthat coursier added to my
.bash_profileI can't use the apps anymore.
JAVA_HOMEto the output of
scalanow spits out
The operation couldn’t be completed. Unable to locate a Java Runtime. Please visit http://www.java.com for information on installing Java..
JAVA_HOMEset, just not with a value provided by couriser
.envrcfile that sets things up using
cs java --envbut I'm still confused how things is intended to work.
cs listthat lists installed apps)?
for this terminal only
sdk use java 17.0.3-zulu
Hello, I'm totally new to Scala so please forgive me in advance if I'm slow on the uptake here... I installed coursier via Homebrew. Then I added a channel from Maven with
cs channel --add https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/maven-metadata.xml. It showed the channel as properly installing. So far so good. But then when I try to install or resolve the package, I get:
cs resolve gatling-charts-highcharts-bundle Exception in thread "main" java.lang.Exception: java.lang.Exception: Error decoding /Users/daniel/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/maven-metadata.xml (https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/maven-metadata.xml): Unexpected content found: <?xml version="1.0" encoding="UTF-8"?>
Any ideas what I'm doing wrong here? Thanks.
java-homecommand to print the path for the
linux-muslversion of the JDK on Alpine?
My company has a proxy repository which all artifact access is fronted by.
As such in sbt, we use the configuration details mentioned here: https://www.scala-sbt.org/1.x/docs/Proxy-Repositories.html#sbt+Configuration in order to configure sbt to correctly resolve artifacts.
The docs referenced speak to a block like this:
[repositories] local my-ivy-proxy-releases: http://repo.company.com/ivy-releases/, [_[scalaVersion]/)(sbt_[ ]/)[ ]/[ ]s/[ ]( ).[ext] my-maven-proxy-releases: http://repo.company.com/maven-releases/]/[ ]/(scala
This works great for sbt, but I am trying to accomplish the same in the coursier CLI (as well as in mill, which I know is outside the scope of this repo).
What would be the raw coursier configuration way to accomplish what sbt does? I'm interested both in how to do this with config files, i.e. using coursier.mirrors, using environment variables and finally using command line options.
What's of particular note is how to configure the ivy pattern in coursier as shown in sbt.
Hey folks, I'm trying to download a binary executable from :
unfortunately, the binaries are not listed in the pom file, so setting types/classifiers in coursier dependencies is not helping. Does coursier allow for downloading a file without it being referenced in the pom ?