Fix process watcher path detection#1427
Fix process watcher path detection#1427testforstephen merged 2 commits intomicrosoft:mainfrom nickbeattie:nickbeattie/fix-process-watcher-path-detection
Conversation
|
@microsoft-github-policy-service agree |
|
@nickbeattie thanks for your contribution. Could you help explain what issue you want to address with this PR? |
|
The company I work for uses Santa for binary authentication. We need to provide a custom Java runtime so that we don't continuously get popups. This PR addresses that by using the alternative JDK/JREs provided by the Java plugin settings. |
|
What pop-ups are you seeing? The JRE lookup in |
|
The popup doesn't come from the plugin; it comes from Santa (link above in my previous comment). This causes an obstructive popup for our engineers. |
testforstephen
left a comment
There was a problem hiding this comment.
@nickbeattie LGTM. thank you for contribution.
This pull request enhances the logic for determining the Java Runtime Environment (JRE) home in the
ProcessWatcherclass, prioritizing user-configured settings and improving fallback mechanisms. It also introduces a utility method to validate JDK paths. Below are the key changes:Improvements to JRE home detection:
java.jdt.ls.java.homesetting if explicitly configured by the user. If the configured path is invalid, a warning is logged, and fallback options are considered. (src/daemon/processWatcher.ts, src/daemon/processWatcher.tsL37-R74)java.configuration.runtimessetting for a default runtime or the first available runtime if no default is set. (src/daemon/processWatcher.ts, src/daemon/processWatcher.tsL37-R74)src/daemon/processWatcher.ts, [1] [2]Utility method for JDK path validation:
isValidJpsPathto check if a given JDK path is valid by verifying its existence and the presence of thejpstool in thebindirectory. (src/daemon/processWatcher.ts, src/daemon/processWatcher.tsR137-R151)