A memorandum for when you want to program lightly in Java and want to read the JAR file directly when setting up the build tool is troublesome.
[Update] for VS Code Java Extensions Pack in April 2020 (https://github.com/microsoft/vscode-java-pack/blob/master/release-notes/v0.9.0.md#work-with-jar- files-directly) can now be read without using Maven / Gradle.
Java Extensions Pack Java Extension Pack is an extension for creating, debugging, and testing Java programs with VS Code. Install from here.
Find "Referenced Libraries" under "JAVA DEPENDENCIES" in the left tab. Click the + button next to "Referenced Libraries" to add the JAR file.
Source: [https://github.com/microsoft/vscode-java-pack/blob/master/release-notes/v0.9.0.md#work-with-jar-files-directly](https://github. com / microsoft / vscode-java-pack / blob / master / release-notes / v0.9.0.md # work-with-jar-files-directly)
I don't know why, but it may not be displayed. Rebooting VS Code itself will usually fix it.
You can set the default by changing
settings.json of VS Code.
"java.project.referencedLibraries": [ "library/**/*.jar" ]