【发布时间】:2020-10-11 12:07:22
【问题描述】:
我正在学习 Java。为了在我的应用程序中读取 JSON,我下载了this JSON library;这是一个自动模块。
我将该库包含在我的模块描述符中,例如:
module art
{
exports art.anixt;
exports art.coartl;
exports art.runeape;
requires org.json; // org.json cannot be resolved to a moduleJava(8389908)
}
我在 vscode 中的 settings.json:
{
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"java.format.settings.url": "Format.xml",
"java.format.settings.profile": "style",
"java.project.referencedLibraries": [
"lib/**/*.jar" // jar file showing in Referenced library(see screenshot)
]
}
如何在我的模块中包含 jar 文件并将其导入到我的 Java 文件中?
截图:
【问题讨论】:
标签: java visual-studio-code java-11 java-module java-platform-module-system