valentjn / vscode-ltex

LTeX: Grammar/spell checker :mag::heavy_check_mark: for VS Code using LanguageTool with support for LaTeX :mortar_board:, Markdown :pencil:, and others
https://valentjn.github.io/ltex
Mozilla Public License 2.0
759 stars 27 forks source link

Could not run ltex-ls with Java #848

Open mengsigao opened 11 months ago

mengsigao commented 11 months ago

Describe the bug Error message comes out every time I open a .tex file in VS Code "Could not run ltex-ls with Java, please see the output panel 'LTeX Language Client' for details. You might want to try offline installation." Offline installation does not solve the issue.

Steps to reproduce Steps to reproduce the behavior:

  1. Open a .tex file in VS Code

Sample document If the bug occurs for a specific document (e.g. LaTeX), please paste it here. If your document is very long or confidential, please create and attach a smaller example for which the bug still occurs so that we can reproduce it.

```latex \documentclass[12pt]{article} \begin{document} hello world \end{document} ```

LTeX configuration Please paste all configuration settings starting with ltex. from your settings.json. You can help us by temporarily removing some irrelevant settings from your settings.json and see if the bug still occurs.

``` { "enabled": [ "bibtex", "context", "context.tex", "html", "latex", "markdown", "org", "restructuredtext", "rsweave" ], "language": "en-US", "dictionary": {}, "disabledRules": {}, "enabledRules": {}, "hiddenFalsePositives": {}, "bibtex": { "fields": {} }, "latex": { "commands": {}, "environments": {} }, "markdown": { "nodes": {} }, "configurationTarget": { "dictionary": "workspaceFolderExternalFile", "disabledRules": "workspaceFolderExternalFile", "hiddenFalsePositives": "workspaceFolderExternalFile" }, "additionalRules": { "enablePickyRules": false, "languageModel": "", "neuralNetworkModel": "", "word2VecModel": "" }, "languageToolHttpServerUri": "", "languageToolOrg": { "username": "", "apiKey": "" }, "ltex-ls": { "path": "", "logLevel": "fine", "languageToolHttpServerUri": "", "languageToolOrgUsername": "", "languageToolOrgApiKey": "" }, "java": { "path": "", "initialHeapSize": 64, "maximumHeapSize": 512 }, "sentenceCacheSize": 2000, "completionEnabled": false, "diagnosticSeverity": { "MORFOLOGIK_RULE_EN_US": "information", "SENTENCE_WHITESPACE": "hint", "COMMA_PARENTHESIS_WHITESPACE": "hint", "PASSIVE_VOICE": "hint", "default": "information" }, "checkFrequency": "edit", "clearDiagnosticsWhenClosingFile": true, "statusBarItem": false, "trace": { "server": "verbose" } } ```

"LTeX Language Server" log file First, reproduce the bug. Then, go to ViewOutput and select LTeX Language Server in the drop-down list. Paste this log here:

``` ```

"LTeX Language Client" log file First, set the ltex.trace.server setting in your settings.json to "verbose". Then, reload the VS Code window and reproduce the bug. Go to ViewOutput and select LTeX Language Client in the drop-down list. Paste this log here (note: it will contain your checked document):

``` 2023-08-13T17:41:30.065Z Info: Setting LTeX UI language to 'en-us'. 2023-08-13T17:41:30.065Z Info: Loading i18n messages... 2023-08-13T17:41:30.066Z Info: Loading default i18n messages... 2023-08-13T17:41:30.069Z Info: 2023-08-13T17:41:30.069Z Info: ltex.ltex-ls.path not set. 2023-08-13T17:41:30.069Z Info: Searching for ltex-ls in 'c:\Users\mengs\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib'... 2023-08-13T17:41:30.069Z Info: ltex-ls found in 'c:\Users\mengs\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'. 2023-08-13T17:41:30.069Z Info: 2023-08-13T17:41:30.069Z Info: Using ltex-ls from 'c:\Users\mengs\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'. 2023-08-13T17:41:30.069Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set. 2023-08-13T17:41:30.070Z Info: Testing ltex-ls... 2023-08-13T17:41:30.070Z Info: Command: "c:\\Users\\mengs\\.vscode\\extensions\\valentjn.vscode-ltex-13.1.0\\lib\\ltex-ls-15.2.0\\bin\\ltex-ls.bat" 2023-08-13T17:41:30.070Z Info: Arguments: ["--version"] 2023-08-13T17:41:30.070Z Info: env['JAVA_HOME']: undefined 2023-08-13T17:41:30.070Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2023-08-13T17:41:30.844Z Error: Test failed. 2023-08-13T17:41:30.844Z Error: Error details: 2023-08-13T17:41:30.844Z Info: ltex-ls terminated with non-zero exit code 1. 2023-08-13T17:41:30.844Z Info: stdout of ltex-ls: 2023-08-13T17:41:30.844Z Info: { 2023-08-13T17:41:30.844Z Info: "ltex-ls": "15.2.0", 2023-08-13T17:41:30.844Z Info: "java": "11.0.12" 2023-08-13T17:41:30.844Z Info: } 2023-08-13T17:41:30.844Z Info: 2023-08-13T17:41:30.844Z Info: stderr of ltex-ls: 2023-08-13T17:41:30.844Z Info: The system cannot find the path specified. 2023-08-13T17:41:30.844Z Info: 2023-08-13T17:41:30.844Z Info: You might want to try offline installation, see https://valentjn.github.io/vscode-ltex/docs/installation-and-usage.html#offline-installation. 2023-08-13T17:41:35.650Z Info: 2023-08-13T17:41:35.651Z Info: ltex.ltex-ls.path not set. 2023-08-13T17:41:35.651Z Info: Searching for ltex-ls in 'c:\Users\mengs\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib'... 2023-08-13T17:41:35.651Z Info: ltex-ls found in 'c:\Users\mengs\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'. 2023-08-13T17:41:35.651Z Info: 2023-08-13T17:41:35.651Z Info: Using ltex-ls from 'c:\Users\mengs\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'. 2023-08-13T17:41:35.651Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set. 2023-08-13T17:41:35.652Z Info: Testing ltex-ls... 2023-08-13T17:41:35.652Z Info: Command: "c:\\Users\\mengs\\.vscode\\extensions\\valentjn.vscode-ltex-13.1.0\\lib\\ltex-ls-15.2.0\\bin\\ltex-ls.bat" 2023-08-13T17:41:35.652Z Info: Arguments: ["--version"] 2023-08-13T17:41:35.652Z Info: env['JAVA_HOME']: undefined 2023-08-13T17:41:35.652Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2023-08-13T17:41:36.268Z Error: Test failed. 2023-08-13T17:41:36.268Z Error: Error details: 2023-08-13T17:41:36.268Z Info: ltex-ls terminated with non-zero exit code 1. 2023-08-13T17:41:36.268Z Info: stdout of ltex-ls: 2023-08-13T17:41:36.268Z Info: { 2023-08-13T17:41:36.268Z Info: "ltex-ls": "15.2.0", 2023-08-13T17:41:36.268Z Info: "java": "11.0.12" 2023-08-13T17:41:36.268Z Info: } 2023-08-13T17:41:36.268Z Info: 2023-08-13T17:41:36.268Z Info: stderr of ltex-ls: 2023-08-13T17:41:36.268Z Info: The system cannot find the path specified. 2023-08-13T17:41:36.268Z Info: 2023-08-13T17:41:36.270Z Info: You might want to try offline installation, see https://valentjn.github.io/vscode-ltex/docs/installation-and-usage.html#offline-installation. 2023-08-13T17:41:38.134Z Info: 2023-08-13T17:41:38.134Z Info: ltex.ltex-ls.path not set. 2023-08-13T17:41:38.134Z Info: Searching for ltex-ls in 'c:\Users\mengs\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib'... 2023-08-13T17:41:38.134Z Info: ltex-ls found in 'c:\Users\mengs\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'. 2023-08-13T17:41:38.134Z Info: 2023-08-13T17:41:38.134Z Info: Using ltex-ls from 'c:\Users\mengs\.vscode\extensions\valentjn.vscode-ltex-13.1.0\lib\ltex-ls-15.2.0'. 2023-08-13T17:41:38.134Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set. 2023-08-13T17:41:38.136Z Info: Testing ltex-ls... 2023-08-13T17:41:38.136Z Info: Command: "c:\\Users\\mengs\\.vscode\\extensions\\valentjn.vscode-ltex-13.1.0\\lib\\ltex-ls-15.2.0\\bin\\ltex-ls.bat" 2023-08-13T17:41:38.136Z Info: Arguments: ["--version"] 2023-08-13T17:41:38.136Z Info: env['JAVA_HOME']: undefined 2023-08-13T17:41:38.136Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx512m" 2023-08-13T17:41:38.762Z Error: Test failed. 2023-08-13T17:41:38.762Z Error: Error details: 2023-08-13T17:41:38.763Z Info: ltex-ls terminated with non-zero exit code 1. 2023-08-13T17:41:38.763Z Info: stdout of ltex-ls: 2023-08-13T17:41:38.763Z Info: { 2023-08-13T17:41:38.763Z Info: "ltex-ls": "15.2.0", 2023-08-13T17:41:38.763Z Info: "java": "11.0.12" 2023-08-13T17:41:38.763Z Info: } 2023-08-13T17:41:38.763Z Info: 2023-08-13T17:41:38.763Z Info: stderr of ltex-ls: 2023-08-13T17:41:38.763Z Info: The system cannot find the path specified. 2023-08-13T17:41:38.763Z Info: 2023-08-13T17:41:38.764Z Info: You might want to try offline installation, see https://valentjn.github.io/vscode-ltex/docs/installation-and-usage.html#offline-installation. 2023-08-13T17:42:36.924Z Info: Creating bug report... 2023-08-13T17:42:36.924Z Info: LTeX Status 2023-08-13T17:42:36.924Z Info: ---------------------------------------- 2023-08-13T17:42:36.924Z Info: Info about vscode-ltex: 2023-08-13T17:42:36.924Z Info: - Path to extension directory: c:\Users\mengs\.vscode\extensions\valentjn.vscode-ltex-13.1.0 2023-08-13T17:42:36.924Z Info: - Path to directory with LTeX user settings (global storage directory): c:\Users\mengs\AppData\Roaming\Code\User\globalStorage\valentjn.vscode-ltex 2023-08-13T17:42:36.924Z Info: - Path to directory with LTeX workspace settings (for the currently opened workspace): n/a 2023-08-13T17:42:36.924Z Info: - Path to directory with LTeX workspace folder settings (for the workspace folder of the currently active text editor): n/a 2023-08-13T17:42:36.924Z Info: - Version: 13.1.0 2023-08-13T17:42:36.924Z Info: Info about ltex-ls: 2023-08-13T17:42:36.924Z Info: - Version: n/a 2023-08-13T17:42:36.924Z Info: - Process ID: n/a 2023-08-13T17:42:36.924Z Info: - Wall clock duration: n/a 2023-08-13T17:42:36.924Z Info: - CPU duration: n/a 2023-08-13T17:42:36.924Z Info: - CPU usage: n/a 2023-08-13T17:42:36.924Z Info: - Total allocated memory: n/a 2023-08-13T17:42:36.924Z Info: - Used memory: n/a 2023-08-13T17:42:36.924Z Info: - Is busy checking: n/a 2023-08-13T17:42:36.924Z Info: - Document URI being checked: n/a 2023-08-13T17:42:36.924Z Info: Currently watched external setting files: n/a 2023-08-13T17:42:36.924Z Info: ---------------------------------------- 2023-08-13T17:42:51.644Z Info: Creating bug report... 2023-08-13T17:42:51.644Z Info: LTeX Status 2023-08-13T17:42:51.644Z Info: ---------------------------------------- 2023-08-13T17:42:51.644Z Info: Info about vscode-ltex: 2023-08-13T17:42:51.644Z Info: - Path to extension directory: c:\Users\mengs\.vscode\extensions\valentjn.vscode-ltex-13.1.0 2023-08-13T17:42:51.645Z Info: - Path to directory with LTeX user settings (global storage directory): c:\Users\mengs\AppData\Roaming\Code\User\globalStorage\valentjn.vscode-ltex 2023-08-13T17:42:51.645Z Info: - Path to directory with LTeX workspace settings (for the currently opened workspace): n/a 2023-08-13T17:42:51.645Z Info: - Path to directory with LTeX workspace folder settings (for the workspace folder of the currently active text editor): n/a 2023-08-13T17:42:51.645Z Info: - Version: 13.1.0 2023-08-13T17:42:51.645Z Info: Info about ltex-ls: 2023-08-13T17:42:51.645Z Info: - Version: n/a 2023-08-13T17:42:51.645Z Info: - Process ID: n/a 2023-08-13T17:42:51.645Z Info: - Wall clock duration: n/a 2023-08-13T17:42:51.645Z Info: - CPU duration: n/a 2023-08-13T17:42:51.645Z Info: - CPU usage: n/a 2023-08-13T17:42:51.645Z Info: - Total allocated memory: n/a 2023-08-13T17:42:51.645Z Info: - Used memory: n/a 2023-08-13T17:42:51.645Z Info: - Is busy checking: n/a 2023-08-13T17:42:51.645Z Info: - Document URI being checked: n/a 2023-08-13T17:42:51.645Z Info: Currently watched external setting files: n/a 2023-08-13T17:42:51.645Z Info: ---------------------------------------- ```

Version information List here the version information of the relevant software.

Additional context/information You can add any other context or information about the problem here. d replace this sentence with the bug report from your clipboard.

XuedaShen commented 8 months ago

Same issue with the above, but with bundled java and ltext-ls

d-graz commented 7 months ago

Same issue for me. I also tried, beside the suggested offline install method, to install external ltex-ls using brew (passing /opt/homebrew as external directory) but whit little to no fortune as vscode-ltex gets stuck in a loop while booting up.\ I'm on M2, macOS version 14.1.2 .

d-graz commented 6 months ago

Update here: after the complete removal of the extension and associated ltex packages installed with brew, I tried once again the installation of the extension through the vs-code extension manager (the built in one). Upon complete download of ltex-ls the extension seems now to be properly working. I'm now on macOS 14.2

richard-porteous commented 1 month ago

I have the same issue with starting VS-Code with markdown file open, but on clicking retry it opens fine. I do not have and do not intend to have java installed.