Compiling To Same Directory As Source

Is there a way to make a Java Project output all compiled files (.class) to the same directory as the source file instead of an "out/" directory?

3 comments
Comment actions Permalink

There is a Project compiler output setting under Project Structure->Project

However, why would you want to do this?

0
Comment actions Permalink

Yes. But, there is no way to set it to use the same directory as source files as far as I can tell. If you leave it empty, it will default to some folder.

Perhaps, there is some special variable you can set it to.

0
Comment actions Permalink

Before solving your question, maybe the solution approach (compile to same folder) is wrong. So why do you want to do this?

This compling target approach is very uncommon and most likely you would see all these .class files in the source folder in Project explorer.

0

Please sign in to leave a comment.