coursier icon indicating copy to clipboard operation
coursier copied to clipboard

there is a `null` in when `cs setup` on Windows.

Open He-Pin opened this issue 2 years ago • 5 comments

PS C:\Users\hepin> cs setup Checking if a JVM is installed Found a JVM installed under C:\Users\hepin.jdks\corretto-1.8.0_382.

Checking if ~\null\Coursier\data\bin is in PATH Should we add ~\null\Coursier\data\bin to your PATH? [Y/n]

He-Pin avatar Sep 14 '23 05:09 He-Pin

Looks like a standard issue with powershell: https://github.com/dirs-dev/directories-jvm/issues/51

tgodzik avatar Sep 14 '23 08:09 tgodzik

@tgodzik https://github.com/tgodzik/metals/commit/e4fd8602ac12b5baf8b13251956b2d5da1a47cf1 you have a pr:)

He-Pin avatar Sep 14 '23 08:09 He-Pin

it's more of a workaround, but we could do the same in coursier

tgodzik avatar Sep 14 '23 08:09 tgodzik

coursier is supposed to be using its own fork of directories-jvm, that shouldn't suffer from as many null errors as mainline directories-jvm, by getting the directories it needs using direct API calls via jni-utils. Powershell is only used as a fallback. So I wouldn't expect the exact same issue as other projects using mainline directories-jvm.

alexarchambault avatar Sep 14 '23 10:09 alexarchambault

@He-Pin Do you confirm you're using the latest coursier version (2.1.7, although 2.1.5 ought to be fine)? Can you try again by setting COURSIER_JNI=force in the environment (should be set COURSIER_JNI=force), and report back what you get?

alexarchambault avatar Sep 14 '23 10:09 alexarchambault