When creating a new Java (not JavaEE) project in Eclipse IDE, I see an option that says Allow output folders for source folders
.
What is that for?
A source folder is marked by Eclipse as containing java sources. Then, when you compile your project Eclipse will look for your source code into all your source folders. You can make any folder become a source folder adding it to the java build path.
Right-click the "java" directory and select Build Path | Use As Source Folder.
Eclipse puts binaries in "project folder/bin/" by default.
It allows defining a separate output folder (i.e. the folder where eclipse creates the compiled .class files) per source folder, instead of storing all the .class files of all source folder in the same output folder.
One little additional hint. I had the same problem, I checked the box, left the dialog and it was unchecked again when I came back.
The solution is very simple, but a little bit hidden for newcomers:
After you have checked that box, you need to open the trees under each of your source folders. You will see a new entry "Output folder" there now, where you can specify individual folders. For instance you keep the output of src/ to go to bin/, but define a specific output folder for test/ (e.g. bin.test/). That way you can grab your real application code from bin/ later (e.g. for putting it in a JAR with an ANT script), but keep bin.test aside.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With