Accepted answer

you can copy your .classpath and .project files to the root of the new project directory and then choose 'import...' from the file menu, and select 'general/existing projects into workspace.' in the resulting dialog, locate the root of the new project directory and finish. make sure that you have deleted the old project from the work space before importing.


using neon - just happened to me too. you would have to delete the eclipse version (not from disk) in your project explorer and import the projects as existing projects. of course, ensure that the project folders as a whole were moved and that the eclipse meta files are still there as mentioned by @koenpeters.

refactor does not handle this.


if you have your project saved as a local copy of a repository, it may be better to import from git. select local, and then browse to your git repository folder. that worked better for me than importing it as an existing project. attempting the latter did not allow me to "finish".


i moved my default git repository folder and therefore had the same problem. i wrote my own class to manage eclipse location and used it to change the location file.

        file locationfile 
            = new file("<workspace>"

        byte data[] = files.readallbytes(locationfile.topath());

        eclipselocation eclipselocation = new eclipselocation(data);

        eclipselocation.changeuri("<new path to project>");

        byte newdata[] = eclipselocation.getdata();


here my eclipselocation class:

public class eclipselocation {

    private byte[] data;
    private int length;
    private string uri;

    public eclipselocation(byte[] data) {

    public string geturi() {
        return uri;

    public byte[] getdata() {
        return data;

    private void init(byte[] data) { = data;   
        this.length = (data[16] * 256) + data[17];
        this.uri = new string(data,18,length);  

    public void changeuri(string newuri) {

        int newlength = newuri.length();
        byte[] newdata = new byte[data.length + newlength - length];        

        int y = 0;
        int x = 0;

        while(y < 16) newdata[y++] = data[x++];

        newdata[16] = (byte) (newlength / 256);
        newdata[17] = (byte) (newlength % 256);

        y += 2;
        x += 2;

        for(int i = 0;i < newlength;i++)
            newdata[y++] = (byte) newuri.charat(i);
        x += length;

        while(y < newdata.length) newdata[y++] = data[x++];

        if(y != newdata.length)
            throw new indexoutofboundsexception();

        if(x != data.length)
            throw new indexoutofboundsexception();




there is now a plugin (since end of 2012) that can take care of this: gensth/projectlocationupdater on github.


this link shows how to edit the eclipse workspace metadata to update the project's location manually, useful if the location has already changed or you have a lot of projects to move and don't want to do several clicks and waits for each one:


much more simple: right click -> refactor -> move.

Related Query

More Query from same tag