Search code examples
javaeclipsebuildpath

Fixing multiple buildpath errors in eclipse


I am working on a MineCraft project at home and at school using eclipse. I can export my project at home and import it at school, however after I import there are 60 build path errors.

At home all of the .jar files are in: \users\clark\ .gradle\caches...*.jar At school all of the .jar files are in almost the same place \users\cs\ .gradle\caches...*.jar

Question 4488247 on StackOverflow shows me how to fix a build path error. However, I would like to avoid making 60 buildpath changes each time I import.

Is there a different way to export to indicate that the build path is relative to my location? Or is there a file that I can update the build path in and do a simple search and replace?

Any help would be appreciated!


Solution

  • It looks like both those directories are your home directory? If so, you should be able to use ~/.gradle/caches...*.jar for both environments. The other thing you could do if that doesn't work is have two .classpath files home.classpath and school.classpath and rename the appropriate one to .classpath and refresh your project in Eclipse. The .classpath file is the file that holds all the classpath entries.

    I would highly recommend using the Gradle plugin for Eclipse. I haven't used it, but it should help you manage these classpath entries automatically.