score:104

Accepted answer

delete the project from eclipse.

ensure that the check box is unselected, during this delete

and then import the project by file -> import -> import existing project and choose it from the new location.

don't try to modify the eclipse files manually!

score:-3

try this. open eclipse --> go to file --> switch workspace --> other --> choose your workspace by clicking the browse button. hope this will work.

score:0

it is not advisable to change the .location file. the eclipse project list will be destroyed if you manually edit the .location file. i lost all the projects after modifying the file.

score:0

admittedly, this is a dated post, but i wanted to mention that i faced this same issue using spring tool suite 3.9.7 when i was pushing my project to a new github repo and something went terribly awry. as a result, i could not run my application locally anymore and had to revert the project location. i had read horror stories about git deleting project files, so i did some research. for the most part, i went with the answer of @kerner1000 above, but with an important addition. please see below steps and explanation.

  • rt. click on the project
  • select "refactor"
  • select "move..."
  • check the checkbox for, "use default location"

note: i tried at first to copy/paste in the path to relocate the project to, but eclipse gave me an over-write error. so checking the checkbox made the difference.

score:0

in eclipse, version: 2020-03 (4.15.0), you can do that:

  1. over the name of project, right click.
  2. select refactor
  3. rename.
  4. indicate the empty folder that will contain the moved source

enter image description here

score:1

you can change the .location file using a hex editor. however, you cannot simply replace the file location string stored there by the new one. you also have to edit the preceding byte defining its length (in bytes) accordingly. you may then re-open the project in eclipse.

score:1

i was working in pydev (python) and this refactor option was not available. i had to switch to the java package manager to accomplish this. after doing that, i switched back to pydev.

score:1

summary of what worked for me (extracted from other answers and comments)

1 (only required if you have already moved the project)

make symlink to the new location from the old location.

2 regardless of the type of project (java, python, etc.)

open view package explorer (window -> show view -> other -> java -> package explorer)
right click -> refactor -> move (in the relevant project within that package explorer)
select new location

3 (if a symlink was created)

delete symlink if one was created in step 1

score:2

i realise this is an old post however i thought i would add my own resolution to the same issue. i had imported a number of projects into my workspace from another machine. however the resource files would not build because for some reason eclipse had marked the location of the projects incorrectly (using a mapped path instead of a unc path). this meant that each time i tried to reference libraries within the workspace they would tick green, then go red and fail. despite the fact the libraries and the project where in the same workspace and i had followed the correct procedure for importing the projects.

as the op mentions under properties there is a project location path. i noticed that the project location was different but for some bizarre reason eclipse (in their almighty wisdom) do not allow you to reselect or change the path. in fact even trying the refactor->move fails because the project is already inside the workspace (never heard of generating a temp folder for moves?).

however i did notice after looking at the file structure of the imported projects that eclipse had added a .location file (mentioned above) which was actually absent from all other projects in the workspace. so i deleted the .location file, reopened eclipse and sure enough the projects build properly.

so after wasting a few hours on something as silly as this i am now able to work and hopefully this might save you some trouble too.

score:17

you can go to [workspace]/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/projectname and try to edit .location which is the pointer to the project, but this file is purposely stored in binary. you should edit the location in file and some binary data ] the binary data that should edit , is bold :

40 b1 8b 81 23 bc 00 14 1a 25 96 e7 a3 93 be 1e 00 5d 55 52 49 2f 2f 66 69 6c 65 3a 2f 44 3a 2f 6d 61 64 64 61 68 2f 50 72 6f 6a 65 63 74 73 2f 46 6c 65 65 74 4d 61 6e 61 67 65 6d 65 6e 74 2f 54 79 70 65 73 2f 50 6f 72 74 61 62 6c 65 63 6f 64 65 2f 46 69 72 6d 77 61 72 65 2f 74 65 73 74 2f 43 50 50 2f 41 54 6d 65 61 67 38 4c 69 62 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c0 58 fb f3 23 bc 00 14 1a 51 f3 8c 7b bb 77 c6

the location of 0x11 of file, is the length of file name, that you should edit it. its value is the length of highlighted part

also you can use projectlocationupdater : https://marketplace.eclipse.org/content/projectlocationupdater/metrics

score:27

much more simple:

right click -> refactor -> move

.


Related Query

More Query from same tag