calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
pez 2021-05-02T06:44:34.422700Z

I would like to try this with the Clojure CLI tools as well, but for some reason clojure does not work on this windows machine of mine.

pez 2021-05-02T06:45:07.422800Z

Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main

pez 2021-05-02T07:37:25.424300Z

I added some more detail, and a repro, as a comment on the issue. https://github.com/BetterThanTomorrow/calva/issues/1162#issuecomment-830765259

pez 2021-05-02T08:43:28.425100Z

And now I find out that I can run this using this Java 16: scoop install adopt16-hotspot

pez 2021-05-02T09:08:26.427500Z

Which was not entirely true. I could only run it in the same shell I had installed it in. It reported the right version but something else is going on. Installing java 16 and running the command from a new shell exposes the error.

pez 2021-05-02T12:15:44.427800Z

Then again. Clean install of adopt16-hotspot now, removed all Oracle things from the PATH and restarted the machine. It works still. So maybe it is an issue only happening with the Java 15/16 installed with the Oracle installer.

2021-05-02T12:56:01.428500Z

using clojure CLI in powershell on my machine

❯ clojure -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""0.8.3""},cider/cider-nrepl {:mvn/version,""0.26.0""}}}"  -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"

Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,0.8.3},cider/cider-nrepl {:mvn/version,0.26.0}}}": java.lang.NumberFormatException: Invalid number: 0.8.3

pez 2021-05-02T13:06:46.429200Z

Try with the CMD prompt, @qmstuart, (that command line is not for PowerShell).

pez 2021-05-02T13:08:41.430100Z

(But maybe the clojure command can’t even be run from the CMD prompt?)

2021-05-02T13:11:19.430300Z

yeah, doesnt recognise it as a command

2021-05-02T13:11:23.430500Z

maybe that's a path pronlem

2021-05-02T13:20:27.431Z

yeah, dont think it will work with cmd, I think clojure CLI installs itself a ps module

pavlosmelissinos 2021-05-02T13:25:18.433600Z

@qmstuart Your -Sdeps string is not valid. You should escape the inner strings with \" (instead of "")

pez 2021-05-02T13:34:33.434300Z

Yeah, you can of course try with PS command line:

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,\"0.8.3\"},cider/cider-nrepl {:mvn/version,\"0.26.0\"}}}'  -m nrepl.cmdline --middleware '[cider.nrepl/cider-middleware]'

2021-05-02T13:38:27.434700Z

❯ clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,\"0.8.3\"},cider/cider-nrepl {:mvn/version,\"0.26.0\"}}}'  -m nrepl.cmdline --middleware '[cider.nrepl/cider-middleware]'
Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,0.8.3},cider/cider-nrepl {:mvn/version,0.26.0}}}": java.lang.NumberFormatException: Invalid number: 0.8.3

1
pavlosmelissinos 2021-05-02T13:43:39.436300Z

Either use ' and " , or " and \" . Both of the following should work:

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.8.3"},cider/cider-nrepl {:mvn/version,"0.26.0"}}}'  -m nrepl.cmdline --middleware '[cider.nrepl/cider-middleware]'
clojure -Sdeps "{:deps {nrepl/nrepl {:mvn/version,\"0.8.3\"},cider/cider-nrepl {:mvn/version,\"0.26.0\"}}}"  -m nrepl.cmdline --middleware '[cider.nrepl/cider-middleware]'

2021-05-02T13:46:43.436500Z

pavlosmelissinos 2021-05-02T13:53:41.437900Z

ah, it seems to be a powershell specific issue. Can you try the following?

clojure -Sdeps "{:deps {nrepl/nrepl {:mvn/version,`"0.8.3`"},cider/cider-nrepl {:mvn/version,`"0.26.0`"}}}"  -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"

pez 2021-05-02T13:55:48.438600Z

That is exactly the same as you get if you use java -jar .calva\deps.clj.jar instead, right?

pez 2021-05-02T13:56:41.439300Z

@pavlos it seems to be a Java issue, actually. Which version of Java are you using?

👍 1
2021-05-02T13:57:34.439400Z

2021-05-02T13:57:50.440Z

sorry for screenshots, but PS seems to be a pain to copy and paste from

2021-05-02T13:58:28.440600Z

yes, same error

2021-05-02T13:58:31.440800Z

pez 2021-05-02T14:01:23.443Z

@qmstuart, I seriously doubt it is a quoting issue. It will probably start to work if you install some other Java, like scoop install adopt11-hotspot and then make sure Windows is using it (which might take removing Oracle java from the system PATH).

pez 2021-05-02T14:22:46.443600Z

@borkdude, @alexmiller it seems that with both clojure and deps.clj we get the results that the argument parsing breaks if using the java 15 installed with Oracles windows installer and that it does not break with earlier java and neither with java 15 if installing, say adopt15-hotspot with scoop. We get the same error/working for the same java versions if the command is spawned from nodejs without any quoting of the arguments. I’m unfamiliar with where this parsing fails. It is peculiar that it is the exact same message, regardless of launcher.

pez 2021-05-02T14:26:15.443800Z

Same result If I use the PS command line from https://clojure.atlassian.net/browse/TDEPS-133#icft=TDEPS-133 Oracle Java 16:

java -jar deps.clj.jar -Sdeps '{:deps {viebel/klipse-repl {:mvn/version ""0.2.3""}}}' -m klipse-repl.main
Error while parsing option "--config-data {:deps {viebel/klipse-repl {:mvn/version 0.2.3}}}": java.lang.NumberFormatException: Invalid number: 0.2.3
Adopt OpenJDK 15:
java -jar .calva\deps.clj.jar -Sdeps '{:deps {viebel/klipse-repl {:mvn/version ""0.2.3""}}}' -m klipse-repl.main
...
Welcome to Klipse REPL (Read-Eval-Print Loop)
Clojure 1.10.3
user=>

pez 2021-05-02T14:27:04.444100Z

(Using deps.clj since I can’t get clojure to work on my machine)

borkdude 2021-05-02T14:57:20.444300Z

@pez Try:

java -jar deps.clj.jar -Sdeps '{:deps {viebel/klipse-repl {:mvn/version \"0.2.3\"}}}' -m klipse-repl.main
in powershell This is what worked for me (on other version of Java, I haven't got Java 16)

pez 2021-05-02T14:58:40.445Z

That’s what is used in TS. Same results. But I can humour you with this one, if you like.

pez 2021-05-02T14:59:54.445200Z

java -jar deps.clj.jar -Sdeps '{:deps {viebel/klipse-repl {:mvn/version \"0.2.3\"}}}' -m klipse-repl.main
Error while parsing option "--config-data {:deps {viebel/klipse-repl {:mvn/version 0.2.3}}}": java.lang.NumberFormatException: Invalid number: 0.2.3

pez 2021-05-02T15:00:13.445400Z

It is not a quoting issue. At least not on this level.

pez 2021-05-02T15:01:01.445600Z

To reproduce, install Java 15 or 16 using Oracle’s installer.

pez 2021-05-02T15:02:02.445800Z

Remember: Same results using no-quoting shell-out.

borkdude 2021-05-02T15:03:15.446Z

and what about no-quoting no-shell execFile?

pez 2021-05-02T15:04:44.446200Z

Haven’t tried. I expect same results. And I have no use for execFile in Getting Started REPL. I can of course try it, if we think it would tell us something.

pez 2021-05-02T15:05:47.446400Z

The one that is tried is no-quoting no-shell spawn.

borkdude 2021-05-02T15:05:58.446600Z

> And I have no use for execFile in Getting Started REPL I've tried to communicate multiple times that I think that this is the preferred way of invoking java from nodeJS, as there is nothing in between

borkdude 2021-05-02T15:06:09.446800Z

But I've apparently failed to do this :)

pez 2021-05-02T15:06:45.447Z

Yes. 😃 But I can try it anyway. Even if I can’t really use it.

borkdude 2021-05-02T15:07:04.447200Z

why can't you really use it, what is the reason? can you be more detailed?

pez 2021-05-02T15:07:28.447400Z

spawn lets me communicate with the process.

borkdude 2021-05-02T15:08:22.447600Z

what kind of communication do you need?

pez 2021-05-02T15:08:32.447800Z

It is a 99.999% guarantee we have the same results with execFile. I will now try it anyway, because if it works, maybe I can hack something around it.

borkdude 2021-05-02T15:09:17.448Z

I think I understand the difference, execFile waits for the process to end, while spawn keeps it running, perhaps?

borkdude 2021-05-02T15:10:06.448200Z

as in, execFile is similar to clojure.java.shell/sh where spawn is more similar to babashka.process/process

borkdude 2021-05-02T15:10:23.448500Z

I see the point there. Thanks

borkdude 2021-05-02T15:11:01.448700Z

So spawn without the shell option would then be the most reliable way without running into shell-specific quoting issues

pez 2021-05-02T15:11:29.448900Z

Indeed. And we are not running in to any shell-specific quoting issues. 😃

borkdude 2021-05-02T15:11:55.449100Z

good!

pez 2021-05-02T15:14:19.449300Z

Yeah. That is great!

borkdude 2021-05-02T15:16:13.449500Z

I see there have been some changes for Windows here: https://github.com/openjdk/jdk/commit/e56e087290dc1fef5d7ba88ec1e955cb49dbce14

borkdude 2021-05-02T15:16:31.449700Z

So maybe the fixes I'm applying for Windows are no longer need in that version

borkdude 2021-05-02T15:18:47.450100Z

Etc. etc. So they may have changed something which doesn't require any additional fixes from the deps.clj side, or something

borkdude 2021-05-02T15:19:39.450300Z

From which version on do you see these differences? With 15 or only higher than 15?

pez 2021-05-02T15:20:31.450500Z

From 15. Even if I haven’t confirmed that myself. But @qmstuart or @stianalmaas was using that.

pez 2021-05-02T15:20:47.450700Z

Also, not with AdoptJDK 15.

borkdude 2021-05-02T15:21:00.450900Z

From and including 15?

pez 2021-05-02T15:21:07.451100Z

I think so.

borkdude 2021-05-02T15:21:23.451300Z

And not with AdoptJDK but only Oracle? Can you get these details verified more precisely?

pez 2021-05-02T15:21:25.451500Z

execFile had the exact same result, btw.

borkdude 2021-05-02T15:21:28.451700Z

ok

pez 2021-05-02T15:22:55.451900Z

I should try it with Oracle Java 15 as well. And confirm that I have tested with adopt 16, (I think I did, but I have tested so many things now…)

pez 2021-05-02T15:23:44.452100Z

I also think I have tried with oracle’s openjdk installed with scoop and that didn’t have the problem. That I can test again now, quickly.

borkdude 2021-05-02T15:23:46.452300Z

I can make an optional CLI arg to skip the "fixes"

pez 2021-05-02T15:25:22.452500Z

I’d be happy to try that.

borkdude 2021-05-02T15:26:14.452700Z

Let me try this:

(and windows? (not (System/getenv "DEPS_CLJ_NO_WINDOWS_FIXES")))
would this work for you?

pez 2021-05-02T15:26:16.452900Z

But let’s try Oracles openjdk scooped first. Unless you think the changes you have seen there are only applied to the one installed via the regular installer.

borkdude 2021-05-02T15:26:25.453100Z

i.e. can you set that env var in powershell?

pez 2021-05-02T15:26:48.453300Z

I can set env vars on the process, yes.

pez 2021-05-02T15:27:08.453500Z

Powershell is not involved, I think.

pez 2021-05-02T15:27:38.453700Z

However. I have no clue how I should determine if the flag should be applied or not.

borkdude 2021-05-02T15:27:51.454Z

This is just for debugging

borkdude 2021-05-02T15:28:35.454200Z

I mean, I will introduce this env var, just for our process of debugging this issue and it will probably be removed thereafter once we find a proper fix

borkdude 2021-05-02T15:29:02.454400Z

@pez Try this one: https://1157-230101668-gh.circle-artifacts.com/0/release/deps.clj-0.0.15-SNAPSHOT-standalone.jar and set the env var

borkdude 2021-05-02T15:31:57.454600Z

I will also try myself now

borkdude 2021-05-02T15:36:02.454800Z

So far so good:

C:\Users\borkdude\Downloads\jdk-16.0.1+9>bin\java.exe -jar %USERPROFILE%\Downloads\deps.clj-0.0.15-SNAPSHOT-standalone.jar
Clojure 1.10.1
user=>

C:\Users\borkdude\Downloads\jdk-16.0.1+9>bin\java.exe -jar %USERPROFILE%\Downloads\deps.clj-0.0.15-SNAPSHOT-standalone.jar --version
Clojure CLI version (deps.clj) 1.10.3.822

borkdude 2021-05-02T15:37:15.455Z

C:\Users\borkdude\Downloads\jdk-16.0.1+9>bin\java.exe -jar %USERPROFILE%\Downloads\deps.clj-0.0.15-SNAPSHOT-standalone.jar -Sdeps "{:deps {med
ley/medley {:mvn/version """1.3.0"""}}}"
Clojure 1.10.3
user=> (require '[medley.core :as medley])
nil

borkdude 2021-05-02T15:37:20.455200Z

No issues from cmd.exe

borkdude 2021-05-02T15:37:57.455400Z

This is AdoptOpenJDK 16.0.1+9

borkdude 2021-05-02T15:39:29.455600Z

Powershell:

PS C:\Users\borkdude\Downloads\jdk-16.0.1+9> bin\java.exe -jar C:\Users\borkdude\Downloads\deps.clj-0.0.15-SNAPSHOT-standalone.jar -Sdeps '{:deps {medley/medley {:mvn/version \"1.3.0\"}}}'
Clojure 1.10.3
user=> (require '[medley.core :as medley])
nil

borkdude 2021-05-02T15:39:39.455800Z

I don't see any issues 🤷

borkdude 2021-05-02T15:40:43.456Z

PS C:\Users\borkdude\Downloads\jdk-16.0.1+9> bin\java.exe -jar C:\Users\borkdude\Downloads\deps.clj-0.0.15-SNAPSHOT-standalone.jar -Sdeps '{:deps {nrepl/nrepl {:mvn/version,\"0.8.3\"},cider/cider-nrepl {:mvn/version,\"0.26.0\"}}}'  -m nrepl.cmdline --middleware '[cider.nrepl/cider-middleware]'
Downloading: cider/cider-nrepl/0.26.0/cider-nrepl-0.26.0.pom from clojars
Downloading: cider/cider-nrepl/0.26.0/cider-nrepl-0.26.0.jar from clojars
nREPL server started on port 65065 on host kubernetes.docker.internal - <nrepl://kubernetes.docker.internal:65065>

borkdude 2021-05-02T15:42:38.456200Z

PS C:\Users\borkdude\Downloads\jdk-16.0.1+9&gt; bin\java.exe -jar C:\Users\borkdude\Downloads\deps.clj-0.0.15-SNAPSHOT-standalone.jar -Sdeps '{:deps {viebel/klipse-repl {:mvn/version \"0.2.3\"}}}' -m klipse-repl.main
Welcome to Klipse REPL (Read-Eval-Print Loop)
Clojure 1.10.3
user=&gt;

borkdude 2021-05-02T15:42:50.456400Z

Everything works as expected here

pez 2021-05-02T15:44:01.456900Z

I think it is only the Java installed by the Oracle installer that has the issue.

borkdude 2021-05-02T15:44:46.457800Z

Everything works as expected on my Windows machine with Java 16.0.1 Note that I don't use backticks like @pavlos but I quote as '{:deps {... {:mvn/version \"...\"}}}' in Powershell and in cmd.exe I escape double quotes with triple double quotes:

"{:deps {... {:mvn/version """..."""}}}"

🤷 1
borkdude 2021-05-02T15:46:15.458800Z

and I did not use the official clojure CLI but deps.clj

borkdude 2021-05-02T15:46:27.458900Z

and which version?

pez 2021-05-02T15:47:17.459100Z

16 for sure.

borkdude 2021-05-02T15:47:27.459300Z

ok I'll try

pez 2021-05-02T15:50:54.459500Z

I’m not sure I am doing it right, but I get the same result with the new jar and the flag set.

pez 2021-05-02T15:51:39.459700Z

PS C:\Users\Peter Strömberg\AppData\Local\Temp\betterthantomorrow.calva\jfj0p3&gt; $env:DEPS_CLJ_NO_WINDOWS_FIXES = "true"
PS C:\Users\Peter Strömberg\AppData\Local\Temp\betterthantomorrow.calva\jfj0p3&gt; echo $DEPS_CLJ_NO_WINDOWS_FIXES        
PS C:\Users\Peter Strömberg\AppData\Local\Temp\betterthantomorrow.calva\jfj0p3&gt; echo $env:DEPS_CLJ_NO_WINDOWS_FIXES
true
PS C:\Users\Peter Strömberg\AppData\Local\Temp\betterthantomorrow.calva\jfj0p3&gt; cd .calva
PS C:\Users\Peter Strömberg\AppData\Local\Temp\betterthantomorrow.calva\jfj0p3\.calva&gt; java -jar deps.clj.jar -Sdeps '{:deps {viebel/klipse-repl {:mvn/version \"0.2.3\"}}}' -m klipse-repl.main    
Error while parsing option "--config-data {:deps {viebel/klipse-repl {:mvn/version 0.2.3}}}": java.lang.NumberFormatException: Invalid number: 0.2.3
PS C:\Users\Peter Strömberg\AppData\Local\Temp\betterthantomorrow.calva\jfj0p3\.calva&gt; 

pez 2021-05-02T15:51:52.459900Z

I am a total Windows noob….

borkdude 2021-05-02T15:52:15.460100Z

Ah, wait, deps.clj invoked a different java binary probably then the one I ran deps.clj with :)

borkdude 2021-05-02T15:52:42.460300Z

Luckily this can be overriden with JAVA_CMD

pez 2021-05-02T15:52:42.460500Z

Has happened to me a thousand times the last 24 hours. 😃

borkdude 2021-05-02T15:53:45.460700Z

C:\Users\borkdude\Downloads\jdk-16.0.1&gt;bin\java.exe -jar C:\Users\borkdude\Downloads\deps.clj-0.0.15-SNAPSHOT-standalone.jar
Clojure 1.10.1
user=&gt; (System/getProperty "java.version")
"16.0.1"
user=&gt; (System/getProperty "java.vendor")
"Oracle Corporation"

pez 2021-05-02T15:53:51.460900Z

Right now I am at a situation where I don’t know how to make Windows use anything else then the Oracle installed Java 16.

borkdude 2021-05-02T15:54:23.461100Z

I avoid this by not using installers, but just download the zip archive and start java manually

pez 2021-05-02T15:54:49.461300Z

You might not be able to repro the problem then, of course.

pez 2021-05-02T15:55:27.461500Z

But it is generally good advice. I’ll be having good use for it.

borkdude 2021-05-02T15:55:28.461700Z

why not? as long as I see the right java version in the repl, it is good

pez 2021-05-02T15:55:52.461900Z

I am not sure. The problem is really strange.

pez 2021-05-02T15:57:34.462800Z

Yes. Works with adopt 16 for me as well.

pez 2021-05-02T15:57:44.463300Z

I can try with the Oracle zip too.

borkdude 2021-05-02T15:57:53.463500Z

So it works with both Oracle and AdoptOpenJDK for me

pez 2021-05-02T15:58:20.463700Z

You haven’t tried the installer yet, though. 😃

borkdude 2021-05-02T15:59:54.463900Z

Fuck the installer, I'm running the right Java version.

borkdude 2021-05-02T16:01:34.464900Z

I cannot reproduce any of the issues with any JDK, Oracle or not. Feel free to reach out if you have some new information.

pez 2021-05-02T16:09:38.465Z

PS C:\Program Files\Java\jdk-16.0.1\bin&gt; .\java.exe -jar .\deps.clj.jar -Sdeps '{:deps {viebel/klipse-repl {:mvn/version \"0.2.3\"}}}' -m klipse-repl.main
Welcome to Klipse REPL (Read-Eval-Print Loop)
Clojure 1.10.3
user=&gt;

borkdude 2021-05-02T16:10:03.465200Z

Can you show the Java properties?

borkdude 2021-05-02T16:10:30.465400Z

or it didn't happen :P

pez 2021-05-02T16:12:06.465600Z

It didn’t happen. AdoptOpenJDK…

borkdude 2021-05-02T16:13:12.465800Z

@pez You need to set the environment variable JAVA_CMD

borkdude 2021-05-02T16:13:25.466Z

to bin\java.exe

borkdude 2021-05-02T16:13:37.466200Z

so deps.clj picks the local one as well

borkdude 2021-05-02T16:14:12.466500Z

$Env:JAVA_CMD = "bin\java.exe"

pez 2021-05-02T16:18:45.466800Z

Thanks. Now it returns “16.0.1” and “Oracle Corporation”

borkdude 2021-05-02T16:18:54.467Z

and no error right?

pez 2021-05-02T16:20:50.467200Z

Exactly.

borkdude 2021-05-02T16:22:34.467400Z

what problem were we solving again?

pez 2021-05-02T16:23:03.467600Z

This:

PS C:\Program Files\Java\jdk-16.0.1\bin&gt; java -jar .\deps.clj.jar -Sdeps '{:deps {viebel/klipse-repl {:mvn/version \"0.2.3\"}}}' -m klipse-repl.main
Error while parsing option "--config-data {:deps {viebel/klipse-repl {:mvn/version 0.2.3}}}": java.lang.NumberFormatException: Invalid number: 0.2.3
PS C:\Program Files\Java\jdk-16.0.1\bin&gt; java -version
java version "16.0.1" 2021-04-20
Java(TM) SE Runtime Environment (build 16.0.1+9-24)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)

borkdude 2021-05-02T16:23:59.467800Z

but you just showed that this works for you right/

pez 2021-05-02T16:24:23.468Z

I showed how it works if I run the java.exe.

pez 2021-05-02T16:24:58.468200Z

But if I run the java command as it is resolved after having used Oracle’s installer, it doesn’t work.

pez 2021-05-02T16:25:40.468400Z

Calva can’t run the exe, because I won’t know where it is on a particular machine.

pez 2021-05-02T16:28:05.469Z

I’ll give it a try.

pez 2021-05-02T16:29:06.469200Z

This might actually work!

borkdude 2021-05-02T16:35:28.469400Z

If you type where java in cmd.exe, which one do you see? it might be some .bat file that Oracle has put there

pez 2021-05-02T16:36:31.469600Z

Powershell reports this one C:\Program Files\Common Files\Oracle\Java\javapath\java.exe which I will now try before I hack Calva around this thing. 😃

pez 2021-05-02T16:38:33.469800Z

😞

pez 2021-05-02T16:38:35.470Z

PS C:\Program Files\Common Files\Oracle\Java\javapath&gt; .\java.exe -jar .\deps.clj.jar -Sdeps '{:deps {viebel/klipse-repl {:mvn/version \"0.2.3\"}}}' -m klipse-repl.main
Error while parsing option "--config-data {:deps {viebel/klipse-repl {:mvn/version 0.2.3}}}": java.lang.NumberFormatException: Invalid number: 0.2.3
PS C:\Program Files\Common Files\Oracle\Java\javapath&gt;

borkdude 2021-05-02T16:39:14.470200Z

you must also set JAVA_CMD to the local one, have you done that?

pez 2021-05-02T16:40:59.470400Z

I hadn’t. But

PS C:\Program Files\Common Files\Oracle\Java\javapath&gt; $env:JAVA_CMD = ".\java.exe"
PS C:\Program Files\Common Files\Oracle\Java\javapath&gt; .\java.exe -jar .\deps.clj.jar -Sdeps '{:deps {viebel/klipse-repl {:mvn/version \"0.2.3\"}}}' -m klipse-repl.main
Error while parsing option "--config-data {:deps {viebel/klipse-repl {:mvn/version 0.2.3}}}": java.lang.NumberFormatException: Invalid number: 0.2.3
PS C:\Program Files\Common Files\Oracle\Java\javapath&gt;

pez 2021-05-02T16:41:34.470600Z

PS C:\Program Files\Common Files\Oracle\Java\javapath&gt; java -version
java version "16.0.1" 2021-04-20
Java(TM) SE Runtime Environment (build 16.0.1+9-24)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)
PS C:\Program Files\Common Files\Oracle\Java\javapath&gt;

pez 2021-05-02T16:42:12.470800Z

PS C:\Program Files\Common Files\Oracle\Java\javapath&gt; .\java.exe -version
java version "16.0.1" 2021-04-20
Java(TM) SE Runtime Environment (build 16.0.1+9-24)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)
PS C:\Program Files\Common Files\Oracle\Java\javapath&gt;

borkdude 2021-05-02T16:43:35.471Z

weird!

pez 2021-05-02T16:45:33.471200Z

The two java.exe:s are different sizes.

borkdude 2021-05-02T16:46:02.471400Z

and can you now try:

$env:DEPS_CLJ_NO_WINDOWS_FIXES = "true"

borkdude 2021-05-02T16:46:16.471700Z

with the failing java.exe one?

pez 2021-05-02T16:46:44.472100Z

Can I get the version of the deps.clj.jar somehow? I don’t know which version I have put thhere.

pez 2021-05-02T16:47:05.472300Z

Is that the same as you pasted before?

borkdude 2021-05-02T16:47:11.472500Z

yes

pez 2021-05-02T16:50:04.472700Z

Hmmm

PS C:\Program Files\Common Files\Oracle\Java\javapath&gt; $env:DEPS_CLJ_NO_WINDOWS_FIXES = "true"
PS C:\Program Files\Common Files\Oracle\Java\javapath&gt; .\java.exe -jar .\deps.clj.jar -Sdeps '{:deps {viebel/klipse-repl {:mvn/version \"0.2.3\"}}}' -m klipse-repl.main
PS C:\Program Files\Common Files\Oracle\Java\javapath&gt;

borkdude 2021-05-02T16:50:16.472900Z

nothing happens?

pez 2021-05-02T16:50:26.473100Z

I get back the prompt.

borkdude 2021-05-02T16:50:52.473300Z

and you still have JAVA_CMD set?

pez 2021-05-02T16:50:54.473500Z

Now need to run.

pez 2021-05-02T16:51:14.473800Z

yes.

pez 2021-05-02T16:51:18.474Z

Same session.

borkdude 2021-05-02T16:52:09.474200Z

weeeeeeeird

borkdude 2021-05-02T16:52:28.474400Z

ok, later. dinner time here as well

pez 2021-05-02T19:22:01.475300Z

Latest findings regarding Getting Started REPL problems on Windows: https://github.com/BetterThanTomorrow/calva/issues/1162#issuecomment-830857709

seancorfield 2021-05-02T19:33:24.476600Z

Does the Oracle installer set any environment variables on Windows? (that you could detect and perhaps figure out an alternative path to set for the CLI finding Java)

stianalmaas 2021-05-03T07:45:12.481300Z

That's some really great sleuthing, Peter! On windows it is only the path that determines which command you will find when you run 'java'. Since Oracle has put their directory first in the path, that one will win. An alternative may be using %JAVA_HOME%\bin\java.exe, but I am not sure if everyone that has java installed has that environment variable set.

pez 2021-05-03T08:01:06.481500Z

Right now I think what’s most urgent is to inform about this on https://calva,io.

pez 2021-05-03T15:25:40.481700Z

And docs are updated now: https://calva.io/getting-started/#theres-a-getting-started-repl

👍 2
pez 2021-05-02T19:38:49.476700Z

I think it does. Even if it is a bit unclear because right now on my test machine, I have no such environment variables that I can see, yet it is Oracle’s java that is used even though I try to scoop reset like crazy.

pez 2021-05-02T19:48:59.476900Z

The challenge remains to find the working executable.

pez 2021-05-02T19:49:32.477100Z

My google fu fails me. I don’t know how to do the equivalent of env on Windows.

seancorfield 2021-05-02T20:56:34.477300Z

In cmd.exe, the set command...

seancorfield 2021-05-02T20:58:17.477500Z

You can get an individual value with set foo:

C:\Users\seanc&gt;set PROMPT
PROMPT=$P$G

C:\Users\seanc&gt;set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\seanc\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=DESKTOP-30ICA76
ComSpec=C:\WINDOWS\system32\cmd.exe
DriverData=C:\Windows\System32\Drivers\DriverData
HOMEDRIVE=C:
HOMEPATH=\Users\seanc

pez 2021-05-02T22:48:53.477800Z

Thanks!

C:\Program Files\Common Files\Oracle\Java\javapath&gt;set
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Peter Strömberg\AppData\Roaming
CLIENTNAME=pez
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=PC
ComSpec=C:\Windows\system32\cmd.exe
DEPS_CLJ_NO_WINDOWS_FIXES=true
DriverData=C:\Windows\System32\Drivers\DriverData
HOMEDRIVE=C:
HOMEPATH=\Users\Peter Strömberg
JAVA_CMD=.\java.exe
JAVA_HOME=C:\Users\Peter Strömberg\scoop\apps\adopt16-hotspot\current
LOCALAPPDATA=C:\Users\Peter Strömberg\AppData\Local
LOGONSERVER=\\PC
NUMBER_OF_PROCESSORS=2
OneDrive=C:\Users\Peter Strömberg\OneDrive
OS=Windows_NT
Path=C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Intel\TXE Components\DAL\;C:\Program Files (x86)\Intel\TXE Components\DAL\;C:\Program Files\Git\cmd;C:\Users\Peter Strömberg\scoop\apps\adopt16-hotspot\current\bin;C:\Users\Peter Strömberg\scoop\apps\openjdk\current\bin;C:\Users\Peter Strömberg\scoop\apps\adopt15-hotspot\current\bin;C:\Users\Peter Strömberg\scoop\apps\adopt14-hotspot\current\bin;C:\Users\Peter Strömberg\scoop\apps\adopt13-hotspot\current\bin;C:\Users\Peter Strömberg\scoop\apps\adopt12-hotspot\current\bin;C:\Users\Peter Strömberg\deps.clj;C:\Users\Peter Strömberg\scoop\apps\nodejs\current\bin;C:\Users\Peter Strömberg\scoop\apps\nodejs\current;C:\Users\Peter Strömberg\scoop\apps\adoptopenjdk-lts-hotspot\current\bin;C:\Users\Peter Strömberg\scoop\shims;C:\Users\Peter Strömberg\AppData\Local\Microsoft\WindowsApps;C:\Users\Peter Strömberg\AppData\Local\Programs\Microsoft VS Code\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 122 Stepping 8, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=7a08
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Users\Peter Strömberg\scoop\modules;C:\Users\Peter Strömberg\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
SESSIONNAME=RDP-Tcp#0
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\PETERS~1\AppData\Local\Temp
TMP=C:\Users\PETERS~1\AppData\Local\Temp
USERDOMAIN=PC
USERDOMAIN_ROAMINGPROFILE=PC
USERNAME=Peter Strömberg
USERPROFILE=C:\Users\Peter Strömberg
windir=C:\Windows

pez 2021-05-02T22:51:26.478Z

The only trace I can see from the installer is that it puts to the problematic binary first in the Path variable…

pez 2021-05-02T22:58:03.478500Z

Bug reported to Oracle about it: https://github.com/BetterThanTomorrow/calva/issues/1162#issuecomment-830920272

pez 2021-05-02T23:00:41.480900Z

Totally failing in finding workarounds. No amount of double quotes or quoting of double quotes gets through. I might end up just trying to detect the situation and then inform the user about installing java from somewhere else. Sucks, but I am completely out of better ideas now.