Eclipse 不使用添加类路径变量中的 jar
我添加了一个指向 jar 缓存的类路径变量(通过 eclipse 的构建路径)。虽然此文件夹显示在 Eclipse 的文件夹视图中,但由于某种原因无法识别其中包含的 jar。
例如,当我导入缓存中的 jar 中存在的类(以及添加的类路径变量)时,eclipse 指示无法解析该类。
任何想法出了什么问题以及如何解决它?
I added a classpath variable (via eclipse's build path) that points to a cache of jars. While this folder is represented in eclipse's folder view, the contained jars are not recognized for some reason.
For example, when I import a class that is present in a jar in the cache (and thus the added classpath variable), eclipse indicates that the class can not be resolved.
Any ideas what is wrong and how to resolve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您必须确保所需的 jar 实际上包含在您正在处理的项目的类路径中。右键单击该项目,转到属性-> java 构建路径并确保已将 jar 添加到项目中。
You have to make sure that the jar(s) that you want are actually included in the classpath of the project you're working on. Right-click on the project, go to properties -> java build path and make sure you've added the jar to your project.
我认为这就是您遇到的问题: https://bugs.eclipse.org /bugs/show_bug.cgi?id=70417
因此,请为增强功能投票 - 这是完成此类事情的唯一方法!
I think this is the problem you are having : https://bugs.eclipse.org/bugs/show_bug.cgi?id=70417
So go vote for the enhancement - it's the only way things like this get done!
我也遇到了同样的问题,最终找到了解决方案。只需将 jar 复制到服务器的 lib 文件夹(例如)apache tomcat 的 lib 文件夹中,然后运行该项目。
I too struggled with the same problem and finally got the solution for it. Just copy the jar's in your server's lib folder eg)apache tomcat's lib folder and then run the project.