Issues trying to move a package

I'm trying to move a package from one parent package to another
and IDEA won't let me (both 3386 and 4.5.4). It tells me:
"Cannot perform refactorings.
Some files or directories are read only."

I'm working with a local project, no source control, one single java module
that contains one content root and several source directories (source,
properties etc). NO file in the project is read-only.

Using the "move" refactoring first brings up the dialog
"Multiple directories correspond to your package, they will all be
changed, continue?"
which is fine, and then brings up the error dialog that I mentioned
earlier. Why?

I can't see how to solve the problem because the message
"some files or directories" doesn't help me much given that
no file is read-only.

Any idea how to address this? Has anyone seen this before?



Comment actions Permalink

You're most probably moving some package like 'com' or similar, which most
probably has occurences in libraries/jdk and thus cannot be moved.
The workaround would be moving unique subpackages one-by-one.

Maxim Shafirov
"Develop with pleasure!"

Comment actions Permalink

Thanks Maxim, there was indeed a jar on the classpath that
had the same package than the one I was trying to move.
Though it wasn't a toplevel but pretty deep into the in-house

I think this problem could easily be avoided. Had the message
explained what was going on I would have been able to deal
with it on the spot.



Please sign in to leave a comment.