-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specifying a Java binary to run the ANTLR4 jar with #57
Comments
The extension uses whatever is available via PATH. Java is called without any path and relies on a search path set. So you are free to specify any path that can be accessed. |
As always thanks for the quick reply. Java binary under WSL is Linux binary, if we try to run it in cmd, it won't work. In order to run it within cmd, we need to call Thus I created a batch file named @echo off
wsl java %* now there is a problem, a windows path e.g. "c:\users\dong\Documents" would need to be converted into "/mnt/c/users/dong/Documents". So there should be more magic to add to above batch file. BTW, your code is not trying to locate a "java.exe" right? So far seems not working yet, the antlr equalizer keeps going, apparently it still can't find java. By all means if you feel this is not worth trying, feel free to ignore me. :) |
As the environment under which the extension runs can be quite different depending on the platform etc. no attempt is made to locate a Java installation. Instead the extension relies on the way how the OS finds a specific binary. However, it should be possible instead of hardcoding the Such a feature would also allow to run arbitrary Java executables, without having them on the search path. If you like that idea we can convert this question to a feature request. |
🥇 |
I have similar problem with setting Java JDK path since I am working on Javascript/Typescript projects and don't want to set Java in my path. It would be better to configure Java JDK path in extension settings. When can this feature request be picked up? |
I'm also hitting this problem here, unfortunately vscode only allows adding env vars to the built in terminal, but not on a per project/global scope, so I'm left with a useless extension due to having no globally availlable java on windows that is in the path. |
Question/Suggestion: Antlr4-tools are now available to install via pip installing Java Runtime Environment at |
…ws users to explicitly set JAVA_HOME if it is not present or if they wish to use a different Java installation. The Java executable is looked up at `${javaHomeOverride}/bin/java` in this case. This also changes the default behavior to use `$JAVA_HOME/bin/java` as the Java executable. If neither of `javaHomeOverride` or the JAVA_HOME environment variable are set then the extension attempts to launch `java` in PATH as before. Fixes issue mike-lischke#57.
…ws users to explicitly set JAVA_HOME if it is not present or if they wish to use a different Java installation. The Java executable is looked up at `${javaHomeOverride}/bin/java` in this case. This also changes the default behavior to use `$JAVA_HOME/bin/java` as the Java executable. If neither of `javaHomeOverride` or the JAVA_HOME environment variable are set then the extension attempts to launch `java` in PATH as before. Fixes issue mike-lischke#57. Signed-off-by: Parker Lamb <parkerlamb@users.noreply.github.com>
…ws users to explicitly set JAVA_HOME if it is not present or if they wish to use a different Java installation. The Java executable is looked up at `${javaHomeOverride}/bin/java` in this case. This also changes the default behavior to use `$JAVA_HOME/bin/java` as the Java executable. If neither of `javaHomeOverride` or the JAVA_HOME environment variable are set then the extension attempts to launch `java` in PATH as before. Fixes issue mike-lischke#57. Signed-off-by: Parker Lamb <parkerlamb@users.noreply.github.com>
…ws users to explicitly set JAVA_HOME if it is not present or if they wish to use a different Java installation. The Java executable is looked up at `${javaHomeOverride}/bin/java` in this case. This also changes the default behavior to use `$JAVA_HOME/bin/java` as the Java executable. If neither of `javaHomeOverride` or the JAVA_HOME environment variable are set then the extension attempts to launch `java` in PATH as before. Fixes issue #57. Signed-off-by: Parker Lamb <parkerlamb@users.noreply.github.com>
Fixed by PR #273 |
On my Windows 10 I have WSL enabled running Ubuntu 14.04, I got JDK8 installed there, now my VS Code is on Windows 10 directly, with your great antlr tooling, any chance I could tell it to use JDK in the WSL? That would save me to install JDK on my Windows directly. Strange question I know. 👍
The text was updated successfully, but these errors were encountered: