redhat-developer / vscode-server-connector

📦 Connects Visual Studio Code to your server adapters and run, deploy apps !!
Eclipse Public License 2.0
56 stars 26 forks source link

Java version checking fails #579

Closed robstryker closed 1 year ago

robstryker commented 1 year ago

An error pop-up notification "Error getting java version for : 'java -version' output was unable to be parsed." is shown at extension startup. It does not happen consistently though. Closer investigation (debugging) revealed that the issue happens due to a race condition in checkJavaVersion function in requirements.ts. cp.execFile() callback is executed after process.on('exit') callback in the problem situation. According to child_process documentation, this can be considered as expected behavior:

When the 'exit' event is triggered, child process stdio streams might still be open.

See https://github.com/redhat-developer/rsp-server-community/issues/185