简体   繁体   English

如何在Eclipse项目(Java)中刷新外部Jars?

[英]How to refresh external Jars in Eclipse project (Java)?

I have a Java project in Eclipse which includes a couple of external jar files. 我在Eclipse中有一个Java项目,它包含一些外部jar文件。 These external jar files are being rebuilt through a different process (not Eclipse, Ant). 这些外部jar文件正在通过不同的进程(而不是Eclipse,Ant)进行重建。 Those changes are not being reflected on the Eclipse project even if I refresh the project. 即使我刷新项目,这些更改也没有反映在Eclipse项目中。 If I close the project and reopen, it works. 如果我关闭项目并重新打开,它就可以了。

Any suggestions on how I could expedite the project without having to close and reopen? 关于如何在不必关闭和重新打开的情况下加快项目的任何建议? Thanks. 谢谢。

Try right click on the project and select refresh. 尝试右键单击项目并选择刷新。 If that does not work, go to the Project menu, clean, and check your project. 如果这不起作用,请转到“项目”菜单,清理并检查项目。

In the package explorer view, you can select the jar and do right click and refresh. 在包资源管理器视图中,您可以选择jar并右键单击并刷新。

Is not available in Eclipse Version: 3.6.1, Build id: M20100909-0800. 在Eclipse版本中不可用:3.6.1,构建ID:M20100909-0800。 I think that version's current. 我认为那个版本是最新的。 A reportable bug IMHO. 一个可报告的错误恕我直言。

Restarting Eclipse works. 重启Eclipse工作。

If the above answers did not work for you and this jar is on your build path. 如果上述答案对你不起作用,那么这个jar就在你的构建路径上。 Do following steps : 请执行以下步骤:

1- remove the jar from the build path(right clicking the jar -> Build Path -> Remove from build path) 1-从构建路径中删除jar(右键单击jar - > Build Path - >从构建路径中删除)

2- add the jar to the build path(right clicking the jar -> Build Path -> Add to build path) 2-将jar添加到构建路径(右键单击jar - > Build Path - > Add to build path)

This worked for me and is much easier than restarting Eclipse. 这对我有用,并且比重启Eclipse要容易得多。

在包资源管理器视图中,您可以选择jar并右键单击并刷新。

If refreshing the project, cleaning the project, refreshing referenced jar (F5) does not work, it might be Maven dependency still referencing old version. 如果刷新项目,清理项目,刷新引用的jar(F5)不起作用,可能是Maven依赖仍然引用旧版本。 If your project uses Maven, remove this jar temporarily from Maven Dependencies list (you can update it later). 如果您的项目使用Maven,请暂时从Maven Dependencies列表中删除此jar(您可以稍后更新)。 It worked for me.. 它对我有用..

I think you should check if you open auto build project option. 我认为您应该检查是否打开了自动构建项目选项。

ProjectAuto Build Project 项目自动建设项目

Everytime I change the method code block , Eclipse would help me build the project to jar. 每次我更改方法代码块时,Eclipse都会帮我构建jar项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM