Extension fails to start right after getting installed.
Microsoft Windows [Version 10.0.19045.5608]
Microsoft Visual Studio Professional 2022 (64-bit) Version 17.12.5
No Java installed
Using SonarQube server
Log from Output window:
[ThreadId 1] Initializing the telemetry package...
[ThreadId 1] Finished initializing the telemetry package...
[ThreadId 55] Initializing the daemon package...
[ThreadId 55] [Connection Migration] Start migrating connections from existing bindings
[ThreadId 55] [Connection Migration] End migrating connections from existing bindings
[ThreadId 1] Current VS version:
Visual Studio Professional 2022
17.12.35728.132
17.12.5
[DEBUG] [ThreadId 1] [ConnectedMode/GitMonitor] No repo detected - nothing to monitor
[ThreadId 6] [SLCoreHandler] Creating SLCore instance
[ThreadId 6] [SLCoreHandler] Starting SLCore instance
[ThreadId 15] [SLCORE-ERR] Error: could not find java.dll
[ThreadId 15] [SLCORE-ERR] Error: Could not find Java SE Runtime Environment.
[ThreadId 6] Loaded settings from "C:\Users\MÄrisCakuls\AppData\Roaming\SonarLint for Visual Studio\settings.json".
[ThreadId 6] [NodeJSLocator] Checking environment variable SONAR_NODEJS_PATH
[ThreadId 6] [NodeJsLocator] Environment variable is not set
[ThreadId 6] [SLCoreHandler] SLCore instance exited
[ThreadId 6] [SLCoreHandler] Creating SLCore instance
[ThreadId 6] [SLCoreHandler] Starting SLCore instance
[ThreadId 6] [NodeJSLocator] Checking environment variable SONAR_NODEJS_PATH
[ThreadId 6] [NodeJsLocator] Environment variable is not set
[ThreadId 10] [SLCORE-ERR] Error: could not find java.dll
[ThreadId 10] [SLCORE-ERR] Error: Could not find Java SE Runtime Environment.
[ThreadId 6] [SLCoreHandler] SLCore instance exited
[DEBUG] [ThreadId 6] [Notifications] Disabled notifications file does not exist. File: C:\Users\Å ausmas\AppData\Roaming\SonarLint for Visual Studio\17\internal.notifications.json
[ThreadId 1] [Notifications] Failed to display notification "sonarlint.sloop.restart.failed": System.NullReferenceException: Object reference not set to an instance of an object.
at SonarLint.VisualStudio.Core.Notifications.NotificationService.ShowInfoBar(INotification notification, Guid toolWindowId)
[ThreadId 6] Finished initializing the daemon package.
[DEBUG] [ThreadId 1] [ConnectedMode/GitMonitor] Monitoring git repo. Root path: C:\local-repo
[ThreadId 65] [ConnectedMode/DotnetAnalyzerIndicator] Service Provider is unavailable
[DEBUG] [ThreadId 27] SLCore service is not available, telemetry is discarded
[ThreadId 48] [SLCore > Workspace Files > Tracking] Service Provider is unavailable
[ThreadId 66] [SLCoreAnalyzer] Analyzing C:\local-repo\SomeProject\Program - Select Weather.cs with id e9536fe4-69b1-4ba9-9f2f-18205006bbdf
[ThreadId 66] [SLCoreAnalyzer] Analysis e0036fe4-69b1-4ba9-9f2f-18205006aadf not ready for file C:\local-repo\SomeProject\Program - Select Weather.cs: Configuration scope not initialized
[ThreadId 1] Initializing the SonarQube for Visual Studio package...
[ThreadId 1] Finishing initializing the SonarQube for Visual Studio package
[ThreadId 86] Initializing the notifications package...
[ThreadId 1] Not connected: not checking for notifications
[ThreadId 1] Finished initializing the notifications package
[ThreadId 1] [Shared Binding] The shared binding configuration file was not found and will not be used. Probed path: not found
Thanks for reporting this issue! Since Java is embedded in the extension, the error āError: could not find java.dllā could indicate a problem with the installation or that some files were blocked by security software.
I would suggest you to reinstall the extension and at the same time try checking your firewall or antivirus if they flagged and blocked the extension or any of its files.
Reinstall the Extension
Uninstall the extension completely.
Restart Visual Studio.
Reinstall the latest version of the extension to ensure all files are properly installed.
Check for Security Software Blocking
Your firewall or antivirus might have flagged and blocked the embedded Java files.
Try checking your antivirus/firewall after reinstalling the extension.
In that case you could add an exception for the extension in your security software.
If the issue persists, please let us know!
Workaround: Manually specify a Java Installation
Another possible but less ideal solution would be to install java on your machine and let the extension use that installation.
To specify a JRE, go to Extensions > SonarQube for Visual Studio > Options⦠> SonarQube for Visual Studio > General > Java Home , add the path to your JRE, and restart your IDE to apply the setting.
After installing the recent update for both VS2022 and SQ extension the error output log looks slightly better but still unable to connect to server.
[ThreadId 1] [Connected Mode > Shared Binding] The shared binding configuration file was not found and will not be used. Probed path: not found
[DEBUG] [ThreadId 167] [SlCoreConnectionAdapter] [IConnectionConfigurationSLCoreService] Service Provider is unavailable
[DEBUG] [ThreadId 144] [SlCoreConnectionAdapter] [IConnectionConfigurationSLCoreService] Service Provider is unavailable
[DEBUG] [ThreadId 164] [SlCoreConnectionAdapter] [IConnectionConfigurationSLCoreService] Service Provider is unavailable
[DEBUG] [ThreadId 150] [SlCoreConnectionAdapter] [IConnectionConfigurationSLCoreService] Service Provider is unavailable
I switched on Verbos logs and also updated Visual Studio again, but that didnāt help much so I just went ahead and installed JDK and specified the path in options.
Thanks for trying the reinstallation and manually setting the JDK path. Itās definitely unexpected that youāre now encountering a āCould not find or load main class⦠ClassNotFoundExceptionā error after that, especially since it worked fine on my test setup with JDK 23 you mentioned above. This suggests the issue might be environment-specific.
Given that the initial problem could have been related to security software or firewall interference, and this new error is also quite unusual for a standard setup, Iād like you to try a few things to help us narrow down the cause:
Disable Other Visual Studio Extensions: Thereās a possibility that another installed extension might be conflicting with SonarQube for Visual Studio. Could you please try disabling all other extensions (except for SonarQube for Visual Studio) and then restarting Visual Studio to see if the issue persists?
Check Security Software/Firewall: Even though youāve reinstalled, itās worth double-checking if any security software (like antivirus or firewall) on your machine might be interfering with the SonarQube extensionās backend processes. Please review your security software settings and ensure that SonarQube for Visual Studio and any related processes are not being blocked.
Re-check Embedded Java (Just in Case): I understand you might have already tried reverting to the embedded Java SE Runtime, but could you please double-check this again? To do this, ensure that the manually added JDK path is completely removed from the SonarQube for Visual Studio extension options within Visual Studio, so it is definitely using its own bundled Java. While I donāt have high hopes for this, itās a quick check to definitively rule it out.
This is indeed a tricky situation, and I appreciate your patience as we try to figure out whatās going on. Please let me know the results of trying these steps, and provide any additional details you think might be relevant.