如何让VS代码知道非JDK类的路径?
我的Java程序会导入下载的非JDK类,并将其放置在与我的Java文件相同的目录中。我如何让VS代码知道该课程的路径,以免在类未解决的错误下得到红色的红色?
当前,当我编译时,我需要java -cp/path/to/non-jdk/class.jar myclass.java
是否有一种方法来添加/path/to/non-jdk/non-jdk/ class.jar
到编译器的搜索路径,这样我就可以java myclass.java
?
My Java program imports a non JDK class downloaded and placed in the same directory as my Java file. How do I let VS Code know the path to this class so I don't get the red under squiggle for class not resolved error?
Currently when I compile I need to java -cp /path/to/Non-JDK/class.jar MyClass.java
is there a way to add /path/to/Non-JDK/class.jar
to the search path of the compiler so I can just java MyClass.java
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以单击
Java Projects
- >引用的库
,它将修改“ java.project.referencelecdlibraries”
在settings.json文件中自动自动,或者您可以直接对其进行修改。You can click Add icon under
JAVA PROJECTS
->Referenced Libraries
, it will modify"java.project.referencedLibraries"
in the settings.json file automatically, or you can modify it directly.