For Java projects, is there any way to mark a source directory without having a parent source directory (IE, having "com/mypackage/..." marked as source without a "src" or source folder)?


Hey guys


    Was wondering if you guys would have any insight on this, I'm working on a legacy project which has "com/somepackage" without being in a source folder.  The project is pretty old and still uses a make file and has been stored in version control, I don't want to change the project structure but rather change my IDE to accommodate.

I guess I could make some a dummy source folder and just symlink the source (com/some-package) and trick the IDE that way but it seems very hacky.  I'm hoping there is a more straightforward way.



Comment actions Permalink

Yes, you can set com/mypackage as the source folder and configure com.mypackage package prefix. See Assigning a package prefix to a folder with Java sources at

Comment actions Permalink

Great!  Thanks Serge, this worked for me!


Many thanks!


Please sign in to leave a comment.