简体   繁体   中英

Java Eclipse - How do I change the classpath?

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.

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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