ltex-plus / vscode-ltex-plus

LTeX+: Grammar/spell checker :mag::heavy_check_mark: for VS Code using LanguageTool with support for LaTeX :mortar_board:, Markdown :pencil:, and others
https://marketplace.visualstudio.com/items?itemName=ltex-plus.vscode-ltex-plus
Mozilla Public License 2.0
63 stars 1 forks source link

Error while starting due to Java issue #60

Closed kabel-knrd closed 3 weeks ago

kabel-knrd commented 1 month ago

Describe the bug Unable to start LTeX+ on Windows due to probably a Java issues (see log).

Steps to reproduce Start VS Code and LTeX+. After a short moment the error messages gets displayed.

Expected behavior LTeX+ starts correctly.

LTeX+ configuration Default config.

"LTeX+ Language Server" log file Drop Down of Server Log is empty.

"LTeX+ Language Client" log file Following the Client Log:

``` 2024-10-09T12:51:58.571Z Info: Setting LTeX UI language to 'de'. 2024-10-09T12:51:58.571Z Info: Loading i18n messages... 2024-10-09T12:51:58.573Z Info: Loading default i18n messages... 2024-10-09T12:51:58.580Z Info: 2024-10-09T12:51:58.580Z Info: ltex.ltex-ls.path not set. 2024-10-09T12:51:58.580Z Info: Searching for ltex-ls in 'c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\lib'... 2024-10-09T12:51:58.580Z Info: ltex-ls found in 'c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\lib\ltex-ls-plus-18.2.0-alpha.nightly.2024-10-09'. 2024-10-09T12:51:58.580Z Info: 2024-10-09T12:51:58.580Z Info: Using ltex-ls from 'c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\lib\ltex-ls-plus-18.2.0-alpha.nightly.2024-10-09'. 2024-10-09T12:51:58.580Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set. 2024-10-09T12:51:58.581Z Info: Testing ltex-ls... 2024-10-09T12:51:58.581Z Info: Command: "\"c:\\Users\\ANONYMIZED\\.vscode\\extensions\\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\\lib\\ltex-ls-plus-18.2.0-alpha.nightly.2024-10-09\\bin\\ltex-ls-plus.bat\"" 2024-10-09T12:51:58.581Z Info: Arguments: ["--version"] 2024-10-09T12:51:58.581Z Info: env['JAVA_HOME']: undefined 2024-10-09T12:51:58.581Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx2048m" 2024-10-09T12:52:13.584Z Error: Test failed. 2024-10-09T12:52:13.585Z Error: Error details: 2024-10-09T12:52:13.587Z Error: Error: spawnSync C:\Windows\system32\cmd.exe ETIMEDOUT 2024-10-09T12:52:13.587Z Error: at Object.spawnSync (node:internal/child_process:1110:20) 2024-10-09T12:52:13.587Z Error: at Object.spawnSync (node:child_process:909:24) 2024-10-09T12:52:13.587Z Error: at DependencyManager. (c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\dist\extension.js:6666:45) 2024-10-09T12:52:13.587Z Error: at Generator.next () 2024-10-09T12:52:13.587Z Error: at fulfilled (c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\dist\extension.js:6288:58) 2024-10-09T12:52:13.588Z Info: ltex-ls terminated due to signal 'SIGTERM'. 2024-10-09T12:52:13.588Z Info: stdout of ltex-ls: 2024-10-09T12:52:13.588Z Info: 2024-10-09T12:52:13.588Z Info: stderr of ltex-ls: 2024-10-09T12:52:13.588Z Info: 2024-10-09T12:52:13.588Z Info: You might want to try offline installation, see https://ltex-plus.github.io/ltex-plus/vscode-ltex-plus/installation-usage-vscode-ltex-plus.html#offline-installation. ```

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

Additional context/information While googling the issue I found an old GitHub-Issue on the valentjn/vscode-ltex Repo. Maybe this is related? https://github.com/valentjn/vscode-ltex/issues/80

Thank you very much for taking over and keeping LTeX+ alive and going! :)

spitzerd commented 1 month ago

valentjn#80 was solved by commit 31faf19b8c06965588fe90c55e3a832fcfaa9921, so I don't think this is the reason.

I have some questions:

  1. Does it work with the offline package?
  2. Are you using a corporate or a private computer? Maybe your employer blocks the execution of scripts.
  3. Do you have and Intel/AMD processor (x64) or an ARM processor?
kabel-knrd commented 1 month ago

Hi!

Thanks for the quick answer!

  1. Neither the online package nor the offline package work.
  2. Using a corporate computer but as far as I know, scripts work. Haven't noticed any problems in my daily work.
  3. Intel, x64.

Interestingly, it seems, that after some time LTeX is more or less working. For e.g. the word VLAN I get a warning for a possible spelling mistake (see Screenshot below). So I think, I wasn't patient enough and the first error message is a false alarm?

image

Here is the corresponding log message of the Server:

``` [Info - 11:36:31] Starte ltex-ls ... Okt. 10, 2024 11:36:40 AM org.bsplines.ltexls.server.LtexLanguageServer initialize INFORMATION: ltex-ls 18.2.0-alpha.nightly.2024-10-09 - initializing... Okt. 10, 2024 11:36:41 AM org.bsplines.ltexls.tools.I18n setLocale INFORMATION: Setting locale to 'de' Okt. 10, 2024 11:36:41 AM org.bsplines.ltexls.server.LtexTextDocumentItem raiseExceptionIfCanceled FEIN: Canceling check due to incoming check request... Okt. 10, 2024 11:36:41 AM org.bsplines.ltexls.settings.SettingsManager$Companion logDifferentSettings FEIN: Reinitializing LanguageTool due to different settings for language 'en-US': setting 'additionalRules.motherTongue', old '', new 'de-DE' Okt. 10, 2024 11:36:41 AM org.bsplines.ltexls.server.DocumentChecker logTextToBeChecked FEIN: Checking the following text in language 'en-US' via LanguageTool: "ANONYMIZED"... (truncated to 100 characters) Okt. 10, 2024 11:36:44 AM org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment FEIN: Obtained 73 rule matches` ```

And of the Client:

``` 2024-10-10T09:36:05.426Z Info: Setting LTeX UI language to 'de'. 2024-10-10T09:36:05.427Z Info: Loading i18n messages... 2024-10-10T09:36:05.429Z Info: Loading default i18n messages... 2024-10-10T09:36:05.437Z Info: 2024-10-10T09:36:05.437Z Info: ltex.ltex-ls.path not set. 2024-10-10T09:36:05.437Z Info: Searching for ltex-ls in 'c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\lib'... 2024-10-10T09:36:05.437Z Info: ltex-ls found in 'c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\lib\ltex-ls-plus-18.2.0-alpha.nightly.2024-10-09'. 2024-10-10T09:36:05.437Z Info: 2024-10-10T09:36:05.437Z Info: Using ltex-ls from 'c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\lib\ltex-ls-plus-18.2.0-alpha.nightly.2024-10-09'. 2024-10-10T09:36:05.437Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set. 2024-10-10T09:36:05.438Z Info: Testing ltex-ls... 2024-10-10T09:36:05.438Z Info: Command: "\"c:\\Users\\ANONYMIZED\\.vscode\\extensions\\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\\lib\\ltex-ls-plus-18.2.0-alpha.nightly.2024-10-09\\bin\\ltex-ls-plus.bat\"" 2024-10-10T09:36:05.438Z Info: Arguments: ["--version"] 2024-10-10T09:36:05.438Z Info: env['JAVA_HOME']: undefined 2024-10-10T09:36:05.438Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx2048m" 2024-10-10T09:36:20.443Z Error: Test failed. 2024-10-10T09:36:20.443Z Error: Error details: 2024-10-10T09:36:20.449Z Error: Error: spawnSync C:\Windows\system32\cmd.exe ETIMEDOUT 2024-10-10T09:36:20.449Z Error: at Object.spawnSync (node:internal/child_process:1110:20) 2024-10-10T09:36:20.449Z Error: at Object.spawnSync (node:child_process:909:24) 2024-10-10T09:36:20.449Z Error: at DependencyManager. (c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\dist\extension.js:6666:45) 2024-10-10T09:36:20.449Z Error: at Generator.next () 2024-10-10T09:36:20.449Z Error: at fulfilled (c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\dist\extension.js:6288:58) 2024-10-10T09:36:20.449Z Info: ltex-ls terminated due to signal 'SIGTERM'. 2024-10-10T09:36:20.449Z Info: stdout of ltex-ls: 2024-10-10T09:36:20.449Z Info: 2024-10-10T09:36:20.449Z Info: stderr of ltex-ls: 2024-10-10T09:36:20.449Z Info: 2024-10-10T09:36:20.450Z Info: You might want to try offline installation, see https://ltex-plus.github.io/ltex-plus/vscode-ltex-plus/installation-usage-vscode-ltex-plus.html#offline-installation. 2024-10-10T09:36:30.183Z Info: 2024-10-10T09:36:30.183Z Info: ltex.ltex-ls.path not set. 2024-10-10T09:36:30.183Z Info: Searching for ltex-ls in 'c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\lib'... 2024-10-10T09:36:30.184Z Info: ltex-ls found in 'c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\lib\ltex-ls-plus-18.2.0-alpha.nightly.2024-10-09'. 2024-10-10T09:36:30.184Z Info: 2024-10-10T09:36:30.184Z Info: Using ltex-ls from 'c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\lib\ltex-ls-plus-18.2.0-alpha.nightly.2024-10-09'. 2024-10-10T09:36:30.184Z Info: Using Java bundled with ltex-ls as ltex.java.path is not set. 2024-10-10T09:36:30.188Z Info: Testing ltex-ls... 2024-10-10T09:36:30.188Z Info: Command: "\"c:\\Users\\ANONYMIZED\\.vscode\\extensions\\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\\lib\\ltex-ls-plus-18.2.0-alpha.nightly.2024-10-09\\bin\\ltex-ls-plus.bat\"" 2024-10-10T09:36:30.188Z Info: Arguments: ["--version"] 2024-10-10T09:36:30.188Z Info: env['JAVA_HOME']: undefined 2024-10-10T09:36:30.188Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx2048m" 2024-10-10T09:36:31.887Z Info: Test successful! 2024-10-10T09:36:31.888Z Info: 2024-10-10T09:36:31.897Z Info: Starte ltex-ls ... 2024-10-10T09:36:31.897Z Info: Command: "\"c:\\Users\\ANONYMIZED\\.vscode\\extensions\\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\\lib\\ltex-ls-plus-18.2.0-alpha.nightly.2024-10-09\\bin\\ltex-ls-plus.bat\"" 2024-10-10T09:36:31.897Z Info: Arguments: [] 2024-10-10T09:36:31.897Z Info: env['JAVA_HOME']: undefined 2024-10-10T09:36:31.897Z Info: env['JAVA_OPTS']: "-Xms64m -Xmx2048m" 2024-10-10T09:36:31.897Z Info: [Trace - 11:36:31] Sending request 'initialize - (0)'. Params: { "processId": 3116, "clientInfo": { "name": "Visual Studio Code", "version": "1.87.2" }, "locale": "de", "rootPath": null, "rootUri": null, "capabilities": { "workspace": { "applyEdit": true, "workspaceEdit": { "documentChanges": true, "resourceOperations": [ "create", "rename", "delete" ], "failureHandling": "textOnlyTransactional", "normalizesLineEndings": true, "changeAnnotationSupport": { "groupsOnLabel": true } }, "configuration": true, "didChangeWatchedFiles": { "dynamicRegistration": true, "relativePatternSupport": true }, "symbol": { "dynamicRegistration": true, "symbolKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 ] }, "tagSupport": { "valueSet": [ 1 ] }, "resolveSupport": { "properties": [ "location.range" ] } }, "codeLens": { "refreshSupport": true }, "executeCommand": { "dynamicRegistration": true }, "didChangeConfiguration": { "dynamicRegistration": true }, "workspaceFolders": true, "foldingRange": { "refreshSupport": true }, "semanticTokens": { "refreshSupport": true }, "fileOperations": { "dynamicRegistration": true, "didCreate": true, "didRename": true, "didDelete": true, "willCreate": true, "willRename": true, "willDelete": true }, "inlineValue": { "refreshSupport": true }, "inlayHint": { "refreshSupport": true }, "diagnostics": { "refreshSupport": true } }, "textDocument": { "publishDiagnostics": { "relatedInformation": true, "versionSupport": false, "tagSupport": { "valueSet": [ 1, 2 ] }, "codeDescriptionSupport": true, "dataSupport": true }, "synchronization": { "dynamicRegistration": true, "willSave": true, "willSaveWaitUntil": true, "didSave": true }, "completion": { "dynamicRegistration": true, "contextSupport": true, "completionItem": { "snippetSupport": true, "commitCharactersSupport": true, "documentationFormat": [ "markdown", "plaintext" ], "deprecatedSupport": true, "preselectSupport": true, "tagSupport": { "valueSet": [ 1 ] }, "insertReplaceSupport": true, "resolveSupport": { "properties": [ "documentation", "detail", "additionalTextEdits" ] }, "insertTextModeSupport": { "valueSet": [ 1, 2 ] }, "labelDetailsSupport": true }, "insertTextMode": 2, "completionItemKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ] }, "completionList": { "itemDefaults": [ "commitCharacters", "editRange", "insertTextFormat", "insertTextMode", "data" ] } }, "hover": { "dynamicRegistration": true, "contentFormat": [ "markdown", "plaintext" ] }, "signatureHelp": { "dynamicRegistration": true, "signatureInformation": { "documentationFormat": [ "markdown", "plaintext" ], "parameterInformation": { "labelOffsetSupport": true }, "activeParameterSupport": true }, "contextSupport": true }, "definition": { "dynamicRegistration": true, "linkSupport": true }, "references": { "dynamicRegistration": true }, "documentHighlight": { "dynamicRegistration": true }, "documentSymbol": { "dynamicRegistration": true, "symbolKind": { "valueSet": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 ] }, "hierarchicalDocumentSymbolSupport": true, "tagSupport": { "valueSet": [ 1 ] }, "labelSupport": true }, "codeAction": { "dynamicRegistration": true, "isPreferredSupport": true, "disabledSupport": true, "dataSupport": true, "resolveSupport": { "properties": [ "edit" ] }, "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" ] } }, "honorsChangeAnnotations": true }, "codeLens": { "dynamicRegistration": true }, "formatting": { "dynamicRegistration": true }, "rangeFormatting": { "dynamicRegistration": true, "rangesSupport": true }, "onTypeFormatting": { "dynamicRegistration": true }, "rename": { "dynamicRegistration": true, "prepareSupport": true, "prepareSupportDefaultBehavior": 1, "honorsChangeAnnotations": true }, "documentLink": { "dynamicRegistration": true, "tooltipSupport": true }, "typeDefinition": { "dynamicRegistration": true, "linkSupport": true }, "implementation": { "dynamicRegistration": true, "linkSupport": true }, "colorProvider": { "dynamicRegistration": true }, "foldingRange": { "dynamicRegistration": true, "rangeLimit": 5000, "lineFoldingOnly": true, "foldingRangeKind": { "valueSet": [ "comment", "imports", "region" ] }, "foldingRange": { "collapsedText": false } }, "declaration": { "dynamicRegistration": true, "linkSupport": true }, "selectionRange": { "dynamicRegistration": true }, "callHierarchy": { "dynamicRegistration": true }, "semanticTokens": { "dynamicRegistration": true, "tokenTypes": [ "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" ], "tokenModifiers": [ "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" ], "formats": [ "relative" ], "requests": { "range": true, "full": { "delta": true } }, "multilineTokenSupport": false, "overlappingTokenSupport": false, "serverCancelSupport": true, "augmentsSyntaxTokens": true }, "linkedEditingRange": { "dynamicRegistration": true }, "typeHierarchy": { "dynamicRegistration": true }, "inlineValue": { "dynamicRegistration": true }, "inlayHint": { "dynamicRegistration": true, "resolveSupport": { "properties": [ "tooltip", "textEdits", "label.tooltip", "label.location", "label.command" ] } }, "diagnostic": { "dynamicRegistration": true, "relatedDocumentSupport": false } }, "window": { "showMessage": { "messageActionItem": { "additionalPropertiesSupport": true } }, "showDocument": { "support": true }, "workDoneProgress": true }, "general": { "staleRequestSupport": { "cancel": true, "retryOnContentModified": [ "textDocument/semanticTokens/full", "textDocument/semanticTokens/range", "textDocument/semanticTokens/full/delta" ] }, "regularExpressions": { "engine": "ECMAScript", "version": "ES2020" }, "markdown": { "parser": "marked", "version": "1.1.0" }, "positionEncodings": [ "utf-16" ] }, "notebookDocument": { "synchronization": { "dynamicRegistration": true, "executionSummarySupport": true } } }, "initializationOptions": { "customCapabilities": { "workspaceSpecificConfiguration": true } }, "trace": "verbose", "workspaceFolders": null } [Trace - 11:36:41] Received response 'initialize - (0)' in 9118ms. Result: { "capabilities": { "textDocumentSync": 1, "completionProvider": {}, "codeActionProvider": { "codeActionKinds": [ "quickfix.ltex.acceptSuggestions" ] }, "executeCommandProvider": { "commands": [ "_ltex.checkDocument", "_ltex.getServerStatus" ] } } } [Trace - 11:36:41] Sending notification 'initialized'. Params: {} ```
kabel-knrd commented 1 month ago

Sorry, mis-click for closing the issue....

spitzerd commented 1 month ago

According to the log, the first try to start LTeX+ failed and the second try worked. Normally, it should work on the first try and that's why it took a while.

Does this happen each time you start VS Code? Or is it sometimes working immediately and sometimes not?

GrSto commented 1 month ago

I have the same issue. This behaviour started only a few days ago. Before, it was working flawlessly. My logs look exactly the same as described in the first post.

Does this happen each time you start VS Code? Or is it sometimes working immediately and sometimes not?

As far as I'm aware, this happens now every time I start VS Code.

When I launch VS Code and the extension fails to start, > LTeX: Show Status Information gives:

LTeX: Show Status Information Output ```log Info: LTeX Status Info: ---------------------------------------- Info: Info about vscode-ltex: Info: - Path to extension directory: c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.1.0 Info: - Path to directory with LTeX user settings (global storage directory): c:\Users\ANONYMIZED\AppData\Roaming\Code\User\globalStorage\ltex-plus.vscode-ltex-plus Info: - Path to directory with LTeX workspace settings (for the currently opened workspace): c:\Users\ANONYMIZED\PATHTOWORKSPACE\.vscode Info: - Path to directory with LTeX workspace folder settings (for the workspace folder of the currently active text editor): c:\Users\ANONYMIZED\PATHTOWORKSPACE\.vscode Info: - Version: 15.1.0 Info: Info about ltex-ls: Info: - Version: n/a Info: - Process ID: n/a Info: - Wall clock duration: n/a Info: - CPU duration: n/a Info: - CPU usage: n/a Info: - Total allocated memory: n/a Info: - Used memory: n/a Info: - Is busy checking: n/a Info: - Document URI being checked: n/a Info: Currently watched external setting files: n/a Info: ---------------------------------------- ```

Running > LTeX: Reset and Restart now actually solves the problem and a new > LTeX: Show Status Information gives:

LTeX: Show Status Information Output ```log Info: LTeX Status Info: ---------------------------------------- Info: Info about vscode-ltex: Info: - Path to extension directory: c:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.1.0 Info: - Path to directory with LTeX user settings (global storage directory): c:\Users\ANONYMIZED\AppData\Roaming\Code\User\globalStorage\ltex-plus.vscode-ltex-plus Info: - Path to directory with LTeX workspace settings (for the currently opened workspace): c:\Users\ANONYMIZED\PATHTOWORKSPACE\.vscode Info: - Path to directory with LTeX workspace folder settings (for the workspace folder of the currently active text editor): c:\Users\ANONYMIZED\PATHTOWORKSPACE\.vscode Info: - Version: 15.1.0 Info: Info about ltex-ls: Info: - Version: 18.1.0 Info: - Process ID: 12624 Info: - Wall clock duration: 29s.423 Info: - CPU duration: 35s.921 Info: - CPU usage: 10.7% Info: - Total allocated memory: 833.62MB Info: - Used memory: 624.43MB Info: - Is busy checking: false Info: - Document URI being checked: n/a Info: Currently watched external setting files: n/a Info: ---------------------------------------- ```

Version information

Same as above, except for VS Code: 1.94.2.

spitzerd commented 1 month ago

The error message indicates a timeout: Error: spawnSync C:\Windows\system32\cmd.exe ETIMEDOUT That surprises me, because the timeout is set to 15 seconds, which is quite long.

Can you both try to execute the start-up script manually? Simply open the Powershell or CMD in Windows, navigate to folder C:\Users\YOUR_USERNAME\.vscode\extensions\ltex-plus.vscode-ltex-plus-LTEX+_VERSION\lib\ltex-ls-plus-LTEX+LS_VERSION\bin and execute .\ltex-ls-plus.bat --version

Untitled

Does the script show the versions for ltex-ls and java like shown in the screenshot? Does it take longer than 15 seconds?

kabel-knrd commented 1 month ago

Hi!

Does this happen each time you start VS Code? Or is it sometimes working immediately and sometimes not?

As far as I noticed, it happens eacht time.

Does the script show the versions for ltex-ls and java like shown in the screenshot? Does it take longer than 15 seconds?

It took about 3 sec to get the following error message.

``` C:\Users\ANONYMIZED\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0-alpha.nightly.2024-10-09\lib\ltex-ls-plus-18.2.0-alpha.nightly.2024-10-09\bin>.\ltex-ls-plus.bat --version Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.UnsupportedClassVersionError: org/bsplines/ltexls/LtexLanguageServerLauncher has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:757) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:473) at java.net.URLClassLoader.access$100(URLClassLoader.java:74) at java.net.URLClassLoader$1.run(URLClassLoader.java:369) at java.net.URLClassLoader$1.run(URLClassLoader.java:363) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:362) at java.lang.ClassLoader.loadClass(ClassLoader.java:419) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:365) at java.lang.ClassLoader.loadClass(ClassLoader.java:352) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:621) ```
spitzerd commented 1 month ago

The error message seems to be caused by an older Java version installed on your computer. Starting from LTeX+ 15.1, Java 21 is used instead of Java 11. I thought that the Java JRE bundled with ltex-ls-plus is taken if nothing else is specified. As a preliminary workaround until there is fix, use the setting ltex.java.path and point it to C:\Users\USERNAME\.vscode\extensions\ltex-plus.vscode-ltex-plus-LTEX+_VERSION\lib\ltex-ls-plus-LTEX+_LS_VERSION\jdk-JDK_VERSION

Please let us know if this setting fixes your issue.

kabel-knrd commented 1 month ago

As far as I can tell at the moment, the workaround works!

Thanks!

spitzerd commented 1 month ago

Great, I will provide a fix in the upcoming days to make your workaround obsolete. I will let you know once you can test the nightly build.

GrSto commented 1 month ago

I don't know why, but I can no longer reproduce the issue. I have not (intentionally) updated any software / reinstalled Java, ...

Does the script show the versions for ltex-ls and java like shown in the screenshot? Does it take longer than 15 seconds?

The command takes less than 2 seconds and outputs:

> .\ltex-ls-plus.bat --version
{
  "ltex-ls": "18.1.0",
  "java": "21.0.4"
}

(I have Eclipse Temurin v21 installed and on Path.)

A colleague of mine with a similar setup had the same problem. Every time she launched VS Code, LTeX+ failed to start. Today, we clicked the blue "Try again" button, and the extension started successfully on the second try (as already reported). This seems to have magically solved the problem: LTeX+ now starts normally on the first try on her machine too.

In any case, thanks a lot for your help and keeping LTeX+ alive!

spitzerd commented 1 month ago

@GrSto That is really strange, but I am happy that your issue is solved 👍

@kabel-knrd What happens if you click on "Try again"?

In the meanwhile, I removed all Java installations from my computer and installed Java 8. I am sorry, but I cannot reproduce the issue in VS Code. It's working perfectly fine. Because vscode-ltex-plus passes env['JAVA_HOME']: undefined, ltex-ls-plus takes the bundled Java installation.

If I open ltex-ls-plus.bat --version manually as described in https://github.com/ltex-plus/vscode-ltex-plus/issues/60#issuecomment-2411015151, I get the same error message. When you execute the command manually, ltex-ls-plus takes the java installation from JAVA_HOME defined in the environment variables in the Windows system settings. This behavior is described in the documentation: https://ltex-plus.github.io/ltex-plus/ltex-ls-plus/server-usage.html#startup Therefore, the error message when executing the command manually is not a bug but it works as defined.

kabel-knrd commented 1 month ago

Hi!

Sorry for my late response!

So I started VS Code and got the error message again, sadly. When clicking "Try again" at the Error-Pop-Up, LTeX starts correctly without any issues.

spitzerd commented 1 month ago

Ok, let's have a last try and increase the timeout. Please go to C:\Users\USERNAME\.vscode\extensions\ltex-plus.vscode-ltex-plus-15.2.0\dist and open the file extension.js with an editor. Replace all occurrences of timeout: 15000 with timeout: 30000. This way, the timeout is set to 30 seconds instead of 15 seconds. If that doesn't help either, I don't know what to do.

github-actions[bot] commented 3 weeks ago

Hi! Per the maintainer guidelines, this issue is automatically closed because it has been stale for too long. The most common reason for an issue to become stale is missing information from its submitter (see one of the previous comments). If the missing information is provided, the issue will be reopened again. Thank you!