flix / vscode-flix

Apache License 2.0
20 stars 22 forks source link

Error message is misleading when `java` not on PATH #198

Closed athas closed 1 year ago

athas commented 2 years ago

I was told that the language extension could not determine the version (which I guess is technically true), but the real issue is that there was no java executable on the path. Telling the user explicitly to install it might be a better error message.

magnus-madsen commented 2 years ago

Ah. Do you remember the error message? I am not so familiar with this part of the code.

Did it crash or did it print something like Flix requires Java 11 or later.?

magnus-madsen commented 2 years ago

Or did it maybe dump something from the shell, like java: command not found?

jhckragh commented 2 years ago

Here's what I see (on Windows 10) if java is not on PATH (with version 0.74.0 of vscode-flix):

flix_without_java

athas commented 2 years ago

Yes, that looks like what I saw as well.

topazus commented 1 year ago

@magnus-madsen After installing flix vscode extension, the similar error message also occured for me.

$ java -version
java version "17.0.5" 2022-10-18 LTS
Java(TM) SE Runtime Environment (build 17.0.5+9-LTS-191)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.5+9-LTS-191, mixed mode, sharing)

image image

magnus-madsen commented 1 year ago

Interesting. Thanks! We are looking into it.

magnus-madsen commented 1 year ago

Let me know if you find a solution.

topazus commented 1 year ago

Let me know if you find a solution.

pretty weird! The flix vscode extension worked today. image

magnus-madsen commented 1 year ago

@mR4smussen I think here we should just change the message to say: "Unable to find java on PATH. Please check that Java is correctly installed and on your PATH".

mR4smussen commented 1 year ago

I think this issue is a lot like the one with the JAVA_HOME and I'm again not sure about getting this variable in a general way for all operating systems without actually using java. What do you think about us simply sending a general message for both variables if we are not able to use java to find the java version here @magnus-madsen ?

("Unable to access Java. Please check that Java is correctly installed and on your PATH and set as JAVA_HOME")

magnus-madsen commented 1 year ago

I think the current solution is fine, just a question of updating the error message.

magnus-madsen commented 1 year ago

Fixed in master.