scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

`--jvm` option with wrong parameter should help find the right value

Open pawelprazak opened this issue 2 years ago • 3 comments

Version(s) 1.0.6

Describe the bug Usability enhancment needed for --jvm param, to allow user to discover and self-correct easily.

To Reproduce Give wrong jvm option, e.g.:

scala-cli --jvm adopt:17
Error: java.lang.Exception: coursier.jvm.JvmCache$JvmNotFoundInIndex: JVM adopt:17 not found in index: JVM adopt not found
For more details, please see '/Users/pprazak/repos/besom/.scala-build/stacktraces/1701076365-7346222702959816796.log'
scala-cli --jvm openjdk:17
Error: java.lang.Exception: coursier.jvm.JvmCache$JvmNotFoundInIndex: JVM openjdk:17 not found in index: JVM openjdk not found
For more details, please see '/Users/pprazak/repos/besom/.scala-build/stacktraces/1701076408-10024759759442678847.log'

Expected behaviour

  • user gets an actionable and easy to understand error message, instead of an exception
  • user gets a list of supported JVM on their machine/OS combo
  • user gets a suggestion what to do to fix the problem successfully

~~AFAIU from this list: https://github.com/shyiko/jabba/blob/master/index.json~~ ~~I assume my MacOS + M1 can only get Azul for some reason.~~

~~The list upstream dependency should be updated to stop aggregating this problem.~~

pawelprazak avatar Nov 27 '23 09:11 pawelprazak

~~I get the SIGSEGV with --jvm temurin:17 and with --jvm adoptium:17~~

pawelprazak avatar Nov 27 '23 10:11 pawelprazak

I get the SIGSEGV with --jvm temurin:17 and with --jvm adoptium:17

Unrelated, tied to https://github.com/VirtusLab/scala-cli/issues/2582 (maybe?)

Gedochao avatar Nov 27 '23 10:11 Gedochao

I'm sorry, wrong window, ofc the commend above was meant to be made in the #2582

pawelprazak avatar Nov 27 '23 12:11 pawelprazak