Search code examples
javaeclipsegitbuildpath

Restore old version of build path in Eclipse


I have a Java application which works with Kafka and Spark Streaming. In the attempt to clean the build path, I messed it up and I don't manage to bring it how it was before. Is it possible to restore an old version of the build path? I have several versions of my project on GitHub, but can I do this with Eclipse?


Solution

  • Eclipse stores the build path details as xml in a file called ".classpath"

    If you track changes to that file in your GitHub project, you should be able to restore back to a previous version of the file. Assuming an appropriate version is at commit a1b2c3, use something like:

    git checkout a1b2c3-- your/project/path/.classpath
    

    See the Git checkout page for more info.