Finally, I will summarize a little about the points I was addicted to and how to deal with them.
OS : Windows10 VSCode : Version 1.41.1
--JDK installation --Java Extension Pack installation --Pass the path to the JDK in Java.home
Access the JDK Download Page
Java SE Development Kit ~ ○ Click Accept License Agreement
After that, you will be able to download the JDK files, so This time, download dk-8u231-windows-x64.exe for Windows x64.
You will then be asked to sign in to your Oracle profile, sign in and the download will begin. If you do not have an account, you can create a new one.
For subsequent installations, follow the on-screen instructions and leave the default settings (without changing the settings).
From the shortcut key of Cntl + Shift + x keys on VSCode or the setting icon at the bottom left of the window Select Extensions
Then a list of extensions will be displayed, so type "java extension pack" in the search form. Click the "Java Extension Pack ~" install button displayed at the top to install.
Wait a moment, and if VS Code shows something like this, the installation is complete.
Open it with the shortcut key of Cntl +, (comma) key, or open the setting screen with the setting icon → [Setting] at the bottom left of the screen.
The setting screen is displayed like this.
Enter "java.home" in the search form at the top of the screen.
Click on the part that says ʻEdit in settings.json`, The json file will open, so
{
"java.home": "C:\\Program Files\\Java\\jdk1.8.0_231"
}
Enter according to the installed version.
In my case, some were mentioned at the beginning, so I added them at the end. (Because the json file needs to be separated by',' (comma) for each item, don't forget to enter',' just before java.home)
python
{
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"java.home": "C:\\Program Files\\Java\\jdk1.8.0_231"
}
This completes the settings. If you close VS Code and reopen it, the development environment construction is complete!
After rebooting, type "create java project" with Cntl + Shift + p and press enter, and if the file system starts up, it's okay.
VS Code crashes at startup An alert appears at the bottom right of VS Code "Extension host terminated unexpectedly." Is displayed in the alert When I opened the detection tool and confirmed the error, "onDidNotificationChange @ notificationsAlerts.ts:40" was displayed.
It seems that the cause was that the path of the json file was not described correctly. After fixing it, it worked fine. It's a general mistake, but it is said that the file "JRE", which is similar to the "JDK" file, was specified as the path. .. ..
If you don't get a direct error, it's difficult to understand the cause, so if you get hooked on building an environment A small mistake will take a lot of time.
If the above does not resolve the symptom, uninstall all Java related extensions once. You may want to try again!
I hope you find this article useful.
Reference site https://www.suzu6.net/posts/130-vscode-for-java/
Recommended Posts