Java Eclipse - 如何更改类路径? [英] Java Eclipse - How do I change the classpath?

查看:757
本文介绍了Java Eclipse - 如何更改类路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Eclipse项目从我的电脑(eclipse驱动器D)复制到笔记本电脑(eclipse是驱动器c),但是当我尝试部署我的项目中的代理程序时,我会收到以下错误:



存档** D **:/ eclipse / plugins / it.fbk.sra.ejade_0.9.0 / lib / libjade4 / commons-codec- 1.3.jar由类路径引用不存在。



我将所有库的地址更改为正确的地址( C:/eclipse/plugins/it.fbk.sra.ejade_0.9.0/lib/libjade4 / __ etc __ ),通过右键单击项目>构建路径>配置构建路径。但是这不行。我也尝试刷新项目,重新启动eclipse,但仍然没有。



任何建议?



谢谢很多!

解决方案

我有同样的问题,只是发现了解决方案。



转到 project> properties> Java Build Path> Libraries>添加外部JARS



之后在特定位置指定JAR文件,您将在以前的窗口构建路径中的JAR和类文件夹中看到它:JAR_fileName - C:\YOURPATH。



不要停在这里,而不要点击左边的+按钮来展开它,如果它说源附件:(NONE),你双击它,并通过选择Workspace将路径添加到JAR文件位置。



这解决了我的问题。


I copied an Eclipse project from my PC (eclipse is on drive D) to the laptop (eclipse is on drive c) but when I try to deploy the agents I have in my project I keep getting the following error:

The archive **D**:/eclipse/plugins/it.fbk.sra.ejade_0.9.0/lib/libjade4/commons-codec-1.3.jar which is referenced by the classpath does not exist.

I changed all the libraries' addresses to the correct ones (C:/eclipse/plugins/it.fbk.sra.ejade_0.9.0/lib/libjade4/__etc__) for all of them by right clicking the project > build path > configure build path... but that doesn't work. I also tried to refresh the project, restart eclipse but still nothing..

Any suggestions?

Thanks a lot!

解决方案

I had the same problem and just discovered the solution to this.

Go to project>properties>Java Build Path>Libraries>Add External JARS.

After specifying JAR file at a certain location, you will see it in previous window "JARs and class folders on the build path:" with "JAR_fileName - C:\YOURPATH".

Don't stop here instead click on the "+" button to the left to expand it, and IF it says "Source attachment: (NONE)", you double click it and add the path to the JAR file by selecting Workspace location.

This solved the problem for me.

这篇关于Java Eclipse - 如何更改类路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆