jvasileff / vscode-ceylon

Visual Studo Code Language Support for Ceylon
Apache License 2.0
12 stars 5 forks source link

support MS Windows #1

Closed jvasileff closed 8 years ago

jvasileff commented 8 years ago

Problems include:

  1. The launch script is (was) looking for ceylon.exe, but should look for ceylon.bat
  2. ceylon.bat reports "you must install Java in order to compile and run Ceylon programs" unless the JAVA_HOME environment variable is set, despite java being in the system path and JavaSoft registry keys existing.
  3. The server reports errors "IllegalArgumentException: 'other' is different type of Path", which hopefully can be fixed by using the right path separators. (This is a java.nio error that leaks through ceylon.file).
jvasileff commented 8 years ago

Regarding item 2, ceylon works fine from the command prompt as long as the following in ceylon.bat is left alone:

:: Find Java in the registry
set "KEY_NAME=HKLM\SOFTWARE\JavaSoft\Java Runtime Environment"

Altering the key causes ceylon to report "Java not found, ...", even though java is in the PATH.

@quintesse do you have any comment/thoughts on why ceylon.bat fails to find Java via the registry when launched by Visual Studio Code? Is this correct/expected? Should ceylon.bat also be looking in the PATH?

quintesse commented 8 years ago

AFAIK in Windows we never look for Java in the PATH. As for why it doesn't find Java I don't know, I'd put in a lot of echos to see what it's doing :) The PAth error is strange too, in general the Java file stuff is pretty flexible in accepting any kind of combination of forward and backward slashes.

jvasileff commented 8 years ago

Windows :/

The error is "ERROR: The system was unable to find the specified registry key or value."

The fix (on my installation) is to add /reg:64 to the REG QUERY command in the batch file. Maybe node is 32 bit and that matters or something. How would I know?

jvasileff commented 8 years ago

Fixed with the temporary workaround of requiring JAVA_HOME. See also https://github.com/ceylon/ceylon/issues/6544