Eclipse workspace as htdocs in XAMPP not working in Mac?
I've bought a MacBook Air(I've been converted from a PC guy to a Mac) today and I have recently installed XAMPP and Eclipse for Mac and I try to set the workspace for Eclipse as the htdocs folder in XAMPP. I always get the warning:
Workspace in use or cannot be created, choose a different one!
The directory i try to set is /Applications/XAMPP/htdocs
I've been trying to set an another directory 开发者_高级运维it works fine as long as it is not the one above. What have I done wrong? I want the directory above. Pls. help
The solution is this:
- Go into the htdocs folder and hit CMD+I to bring up the "Get Info" window
- In this window, go to the bottom right and click on the padlock icon, enter your password to unlock the permissions settings in the window
- You'll see a list of users and their respective permissions. Change the "admin"'s permission to "Read & Write"
- Click the padlock once more to save your changes and lock the permissions for the htdocs folder
- Start up Eclipse and then select htdocs as your workspace, and
- Voila! You're done.
Hope that helps.
It's likely a permissions issue. The application may not be requesting admin rights to write to (or in some way control) that directory, it may just be silently failing. Generally, you need to supply admin rights to modify anything under /Applications/
.
I wouldn't recommend using /Applications/XAMPP/htdocs/
as your workspace anyway. Your workspace should either be in your home directory (Documents
or perhaps even Library
though the former would be more intuitive), or in some other shared location if multiple users need to access it. Bundling it with the application itself would risk losing the data during an application upgrade, or in some other way confusing the issue.
Why do you want your data in the /Applications/
directory?
The problem here is that this workspace is locked. The quick solution is to delete /Applications/XAMPP/htdocs/.metadata/.lock
The slightly longer solution is to try the following command whenever such a situation occurs: find /Applications/XAMPP/htdocs -name "lock" -exec echo {} \;
This will show you any file in that directory that has lock in the name. Remember that hidden files start with a . (such as .lock or .metadata).
The even longer answer is that /Applications is outside of the userspace and should not be used for user documents (like code files). These should ideally be moved to somewhere in /Users or into a directory specifically created for this purpose (such as /home or /shared). I'm particularly fond of having a /Users/Shared directory for sharing files between accounts.
精彩评论