How to rename "src" to "src/java"? [message #503848] |
Tue, 15 December 2009 19:44  |
Eclipse User |
|
|
|
I have a project that I created the initial source folder for as "src". There are now a few packages there. I now want to change to use "src/java" so I can create at least one peer directory to "java" for other things. I would think this would be a simple thing to do, but I can't figure out how to do it.
I think it's entirely possible I could safely make this change by exiting Eclipse, creating "src/java", moving "src/*" to "src/java", then hand-edit the ".classpath" file to reflect this, then restart Eclipse. I'm a little leery of doing this, and I really should be able to do this inside Eclipse.
I tried doing a simple "rename" of "src" to "src/java", but it wouldn't let me do that.
Any ideas?
|
|
|
Re: How to rename "src" to "src/java"? [message #503855 is a reply to message #503848] |
Tue, 15 December 2009 23:38   |
Eclipse User |
|
|
|
David M. Karr wrote:
> I have a project that I created the initial source folder for as "src".
> There are now a few packages there. I now want to change to use
> "src/java" so I can create at least one peer directory to "java" for
> other things. I would think this would be a simple thing to do, but I
> can't figure out how to do it.
>
> I think it's entirely possible I could safely make this change by
> exiting Eclipse, creating "src/java", moving "src/*" to "src/java", then
> hand-edit the ".classpath" file to reflect this, then restart Eclipse.
> I'm a little leery of doing this, and I really should be able to do this
> inside Eclipse.
>
> I tried doing a simple "rename" of "src" to "src/java", but it wouldn't
> let me do that.
>
> Any ideas?
I think I might do it in two steps. First, create a second source directory
named "foo" at the same level as src, and drag all your packages from src into
foo. Then, remove the (empty) "src" source folder, create a "src/java" source
folder, and drag the packages back.
I just tried this with a small project and it worked fine. However, the output
directory is still "bin". If you want to change that to "bin/java", you can
edit the Java Build Path properties.
|
|
|
Re: How to rename "src" to "src/java"? [message #504026 is a reply to message #503848] |
Wed, 16 December 2009 10:50  |
Eclipse User |
|
|
|
On 12/15/09 7:44 PM, David M. Karr wrote:
> I have a project that I created the initial source folder for as "src".
> There are now a few packages there. I now want to change to use
> "src/java" so I can create at least one peer directory to "java" for
> other things. I would think this would be a simple thing to do, but I
> can't figure out how to do it.
>
> I think it's entirely possible I could safely make this change by
> exiting Eclipse, creating "src/java", moving "src/*" to "src/java", then
> hand-edit the ".classpath" file to reflect this, then restart Eclipse.
> I'm a little leery of doing this, and I really should be able to do this
> inside Eclipse.
>
> I tried doing a simple "rename" of "src" to "src/java", but it wouldn't
> let me do that.
1) Create java/ under src/ and move all your code files into src/java/
2) Open the project's properties and edit the Java Build Path > Source
tab to remove src/ and add src/java/ as a source location.
By the way, you can manually edit .classpath and save it and Eclipse
will adapt to the changes "on the fly" - no need to shut down Eclipse.
Hope this helps,
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.10765 seconds