Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open Eclipse project as read-only?

Tags:

Does anyone know is there a way to open a project in Eclipse in read-only mode? If there is a lot of similar projects open it is easy to make changes to a wrong one.

like image 251
serg Avatar asked Sep 18 '08 21:09

serg


People also ask

How do I change read-only mode in Eclipse?

A plugin can do this. But I thought up a tricky one. Set all the files under that project as read-only, and make them only writable and controllable by Admin Group, then start eclipse without admin privilege. I've tested that the dialog won't show up.

How do I open an entire project in Eclipse?

Reopening a Closed Project To reopen a closed project, in the Package Explorer view, select the closed project and click on the Project menu and select Open Project. Once the project is open its content can be edited using the Eclipse user interface.


2 Answers

Putting project in read-only mode is really useful, when you make another instance from the previous project. So you copy all files from old project, then make changes in the new instance. It's really simple to edit files from old project by mistake (they have the same names)!

Serg if you use linux, I suggest to put all files in read only mode with chmod in terminal:

sudo chmod 444 -R /path/to/your/project 

After this operation Eclipse will tell you that file you are trying to edit is in read-only mode. I think that's enough to make the previous project safe :)

like image 107
s3m3n Avatar answered Sep 30 '22 20:09

s3m3n


One sub-optimal solution is to make the project directory read-only in the file system in the underlying OS. I'm not sure how eclipse will react though.

like image 36
Martin OConnor Avatar answered Sep 30 '22 20:09

Martin OConnor