File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -91,15 +91,24 @@ async function fromPathEnv(): Promise<string[]> {
9191 try {
9292 buffer = cp . execSync ( macUtility , { cwd : dir } ) ;
9393 const absoluteJavaHome = "" + buffer . toString ( ) . replace ( / \n $ / , "" ) ;
94- ret . push ( absoluteJavaHome ) ;
94+ const verified = await verifyJavaHome ( absoluteJavaHome , JAVAC_FILENAME ) ;
95+ if ( verified ) {
96+ ret . push ( absoluteJavaHome ) ;
97+ }
9598 } catch ( error ) {
9699 // do nothing
97100 }
98101 }
99102 }
100103 }
101104
102- return ret ;
105+ if ( isMac ) {
106+ // Exclude /usr, because in macOS Big Sur /usr/bin/javac is no longer symlink.
107+ // See https://github.com/redhat-developer/vscode-java/issues/1700#issuecomment-729478810
108+ return ret . filter ( item => item !== "/usr" ) ;
109+ } else {
110+ return ret ;
111+ }
103112}
104113
105114async function fromWindowsRegistry ( ) : Promise < string [ ] > {
You can’t perform that action at this time.
0 commit comments