All of sudden when I open project with visual studio code, it shows error.
The java.jdt.ls.java.home variable defined in Visual Studio Code settings points to a missing or inaccessible folder (/Users/hayat/Library/Application Support/Code/User/globalStorage/pleiades.java-extension-pack-jdk/java/17)
When I open settings.json
, it shows below.
"java.configuration.runtimes": [
{
"name": "JavaSE-1.8",
"path": "/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home"
},
{
"name": "JavaSE-11",
"path": "/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home"
},
{
"name": "JavaSE-17",
"path": "/Users/hayat/Library/Application Support/Code/User/globalStorage/pleiades.java-extension-pack-jdk/java/17",
"default": true
},
{
"name": "JavaSE-20",
"path": "/Users/hayat/Library/Application Support/Code/User/globalStorage/pleiades.java-extension-pack-jdk/java/20"
}
],
I can’t find pleiades.java-extension-pack-jdk in globalStorage folder from finder.
I installed openjdk@17 but still this file doesn’t exist.
brew install openjdk@17
I didn’t see this error before, but all of sudden it appears.
How to resolve this issue?
2
Answers
Your Java 17 path is no longer valid.You need to change the path to the new location.If you are running MacOS on Apple Silicon Mac the java path for
brew install openjdk@17
should be:/Library/Java/JavaVirtualMachines/openjdk-17.jdk/Contents/Home/bin/java
Its globalStorage folder is provided by the VSCode extension
Extension Pack for Java Auto Config
. Install this extension.https://marketplace.visualstudio.com/items?itemName=Pleiades.java-extension-pack-jdk