Java Eclipse - How do I change the classpath?

2019-06-04 12:50发布

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!

4条回答
淡お忘
2楼-- · 2019-06-04 13:15

Had the same problem and non of the above solutions worked.

This is how I fixed it.

  1. go to your project folder
  2. open .classpath file (enable view hidden files if its not showing)
  3. edit the path
  4. delete the project from workspace. Imp: Don't select (Delete project content) checkbox when prompted. !!!
  5. re-import the same project
查看更多
在下西门庆
3楼-- · 2019-06-04 13:17

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.

查看更多
走好不送
4楼-- · 2019-06-04 13:21

First make sure that the .jar file is exist in the given path,if so then you can easily try making a new project and copy your material to it, and configure it to the .jar path.

If this doesn't work you may need to remove the temporary files from your project and eclipse on your laptop.

Also, please give more description about what happens on right clicking the project > build path > configure build path ?

Hope everything works well.

查看更多
冷血范
5楼-- · 2019-06-04 13:36

I had the same issue... I was refering jars from a mapped drive, when I moved them to my local drives, it started working fine. Also try giving a shorte path for the jars.

查看更多
登录 后发表回答