Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 226912

Summary: [build path] 'Allow output folders for source folders' checkbox gets unchecked
Product: [Eclipse Project] JDT Reporter: Nicolas Raoul <nicolas.raoul>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P5 CC: daniel_megert, emoffatt, jerome_lanneluc, martinae, nicolas.raoul
Version: 3.4   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Nicolas Raoul CLA 2008-04-14 08:15:06 EDT
Build ID:  I20080207-1530

Steps To Reproduce:
1. Create new general project "test1"
2. Create directories "src" and "build"
3. Add a Java nature to the project, by inserting <nature>org.eclipse.jdt.core.javanature</nature> between <natures> and </natures> in the .project file.
4. In the project's properties', click on "Java Build path", select "test1/src" for sources, check the "allow output folders for source folders" box and select "test1/build" as a "default output folder".
5. Click OK.
6. Reopen the same dialog.
7. The "allow output folders for source folders" checkbox is not checked.

Expected behavior:
When the user checks a box and clicks OK, it should stay checked.
Comment 1 Nicolas Raoul CLA 2008-04-14 08:49:06 EDT
The bug is more general, the checkbox gets unchecked if the following is not present in .project :

<buildSpec>
  <buildCommand>
    <name>org.eclipse.jdt.core.javabuilder</name>
    <arguments>
    </arguments>
  </buildCommand>
</buildSpec>
Comment 2 Martin Aeschlimann CLA 2008-04-15 04:37:09 EDT
Note that this not the way you create a Java project. Use the New Java project wizard for this.
Then you will have both the nature and also the builder set and you shouldn't see the problem you're describing. I just tested this and it seems to work.
Comment 3 Nicolas Raoul CLA 2008-04-15 04:49:21 EDT
You can NOT use the "New Java project" wizard when checking out a project from SVN.

If the project was not created using Eclipse, then there is no configured ".project" and you get the general ".project" file with no natures. That is a case where you will HAVE to edit ".profile" manually.

So no, the "New Java project" wizard is not a solution for this bug.

Cheers,
Nicolas.
Comment 4 Martin Aeschlimann CLA 2008-04-15 05:16:35 EDT
You can add yourself on the bug 'Add Java nature' action (bug 102527).

When you manually change the file (at your own risk), don't forget to add nature and builder. 

Moving to jdt.core to comment. Should we support this scenario (only nature, no builder) and if yes, why isn't the output folder stored?
Comment 5 Jerome Lanneluc CLA 2008-08-26 04:54:23 EDT
Actually, the problem has nothing to do with the fact that the Java builder is not registered. The problem seems to be that no specific output folder is specified for "src" ("build" is the default output folder).

You can reproduce the problem if you create the Java project using the New Java Project wizard.

I'm not sure what is the condition for the checkbox "allow output folders for source folders" to be checked. But there is nothing at the JDT/Core level to remember this condition.

Moving back to JDT/UI
Comment 6 Dani Megert CLA 2008-08-26 05:57:11 EDT
This is by design to reduce cluttering the UI. As soon as one of the source folders indeed has a non-default folder the checkbox will be checked.

We could globally store the users choice to always show the source folder's output folder in the UI but that's really low prio.
Comment 7 Eclipse Genie CLA 2020-01-16 19:20:37 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.