You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running on macOS using Apple M1, the ltex extension for LaTeX doesn't work.
The log looks something like this:
2023-04-24T07:33:09.822Z Info: Searching for ltex-ls in '/home/ajtzib/.vscode-server/extensions/valentjn.vscode-ltex-13.1.0/lib'...
2023-04-24T07:33:09.823Z Info: ltex-ls found in '/home/ajtzib/.vscode-server/extensions/valentjn.vscode-ltex-13.1.0/lib/ltex-ls-15.2.0'.
2023-04-24T07:33:09.823Z Info:
2023-04-24T07:33:09.823Z Info: Using ltex-ls from '/home/ajtzib/.vscode-server/extensions/valentjn.vscode-ltex-13.1.0/lib/ltex-ls-15.2.0'.
2023-04-24T07:33:09.823Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set.
2023-04-24T07:33:09.825Z Info: Testing ltex-ls...
2023-04-24T07:33:09.825Z Info: Command: "/home/ajtzib/.vscode-server/extensions/valentjn.vscode-ltex-13.1.0/lib/ltex-ls-15.2.0/bin/ltex-ls"
2023-04-24T07:33:09.825Z Info: Arguments: ["--version"]
2023-04-24T07:33:09.825Z Info: env['JAVA_HOME']: undefined
2023-04-24T07:33:09.825Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2023-04-24T07:33:09.835Z Error: Test failed.
2023-04-24T07:33:09.835Z Error: Error details:
2023-04-24T07:33:09.835Z Info: ltex-ls terminated with non-zero exit code 255.
The reason is, that the Java Runtime Environment (JRE) is not shipped with the extension for Apple Silicon (ARM64).
The problem can be somewhat mitigated when the JRE is installed manually (e.g. using brew).
The environment variable JAVA_HOME has to be set to the path of installation.
Additionally, inside the settings.json of VSCode, one has to specify the location using ltex.java.path
This issue also applies to Docker images as the Ubuntu guest system is also based on ARM64 on an Apple Silicon.
One part of a fix would be to install the JRE in the Docker container (adding an appropriate install command to Dockerfile.
However, adding the ltex.java.path to the general settings file is discouraged as other systems would not find the JRE automatically anymore.
I don't think it's worth requiring all users to have Java installed and setting the configuration in settings.json.
This would contradict the "it works out-of-the-box" approach here.
yax-lakam-tuun
changed the title
LTex Extension for VSCode doesn't work properly with Apple M1
LTex Extension for VSCode doesn't work properly with Apple Silicon (M1/M2)
Apr 24, 2023
yax-lakam-tuun
changed the title
LTex Extension for VSCode doesn't work properly with Apple Silicon (M1/M2)
LTex Extension for VSCode doesn't work properly with Apple Silicon
Jan 11, 2025
A fix is possible by installing Java inside the container.
The container specific devcontainer.json gets the additional setting mentioned above: "ltex.java.path": "/usr".
Then, the ltex extension is able to find Java inside the container.
This fix should work in all scenarios regardless of operating system and being in a container or not.
When running on macOS using Apple M1, the ltex extension for LaTeX doesn't work.
The log looks something like this:
The reason is, that the Java Runtime Environment (JRE) is not shipped with the extension for Apple Silicon (
ARM64
).The problem can be somewhat mitigated when the JRE is installed manually (e.g. using brew).
The environment variable
JAVA_HOME
has to be set to the path of installation.Additionally, inside the settings.json of VSCode, one has to specify the location using
ltex.java.path
This issue also applies to Docker images as the Ubuntu guest system is also based on
ARM64
on an Apple Silicon.One part of a fix would be to install the JRE in the Docker container (adding an appropriate install command to
Dockerfile
.However, adding the
ltex.java.path
to the general settings file is discouraged as other systems would not find the JRE automatically anymore.I don't think it's worth requiring all users to have Java installed and setting the configuration in
settings.json
.This would contradict the "it works out-of-the-box" approach here.
To be investigated...
Links regarding this topic:
valentjn/vscode-ltex#224
valentjn/vscode-ltex#634
Required steps to install Java (
openjdk-18-jre
) in Docker:Line to install in settings.json:
"ltex.java.path": "/usr"
The text was updated successfully, but these errors were encountered: