导入org.xxx无法解决
我是Java的新手,所以请忍受我...
我已经将JFReechart-1.5.0.Jar文件放在LIB文件夹中,并想做一些这样的导入:
import org.jfree.chart.ChartFactory;
但是VS代码在抱怨:导入org。 JFRE无法解决。
我要提到的一件事是,我创建了一个项目文件夹的副本,以便尝试某些内容。因为它起作用,所以我删除了原始文件夹,并将副本重命名为原始文件夹的名称。
但是现在我有一个问题是导入不再起作用,即使是相同的代码也是如此。我已经“清洁了Java语言服务器工作区”,但这无济于事。
我还有什么要做的吗? JAR导入指向某个路径 /文件吗?
I'm new to Java, so bear with me...
I have placed a jfreechart-1.5.0.jar file in a lib folder and wanted to do do some imports like this:
import org.jfree.chart.ChartFactory;
But VS Code is complaining: the import org.jfree cannot be resolved.
One thing I have to mention is, that I have created a copy of the project folder in order to try something. Because it worked, I have deleted the original folder and renamed the copy to the name of the original folder.
But now I have the problem that the imports do not work anymore, even it's the same code. I have "cleaned Java language server workspace" but it didn't help.
Is there anything else I have to do? Is the jar import pointing to a certain path / file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于Maven项目,您可以通过单击项目视图中Maven依赖性节点旁边的 +图标来添加依赖关系。
如果您的项目是一个不管理的文件夹,而没有任何构建工具。您可以通过单击引用的库节点上的 +图标或 - 图标来管理依赖项。
For Maven project, you can add a dependency by clicking the + icon next to Maven Dependencies node in project view.
If your project is an unmanaged folder without any build tools. You can manage the dependencies by clicking the + icon or the - icon on the Referenced Libraries node or the items under it.
我必须将JAR文件引用到项目。
出乎意料的是,第一次自动引用它时,我第二次必须手动进行……
I had to reference the jar file to the project.
Surprisingly the first time it has been referenced automatically, the second time I had to do it manually...