Bug 17618 Changing output location should delete all derived resources
F1 1) create a project (autobuild on) 2) import Java sources and resources 3) change output folder to project/bin ->all class files are removed (fine) 4) change output folder back to be the project -> all class files are removed (fine) 5) open project/bin -> all resources are still there Note: When opening the properties dialog on such a resource it is tagged as "Derived". Thus, it should be possible to remove all derived resources as long as they have been created by the Java builder.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
* but all existing settings will be cleared and replace by the given or default paths.
	 * @param project The java project to configure. Does not have to exist.
	 * @param outputLocation The output location to be set in the page. If <code>null</code>
	 * is passed, jdt default settings are used, or - if the project is an existing Java project- the
	 * output location of the existing project 
	 * @param classpathEntries The classpath entries to be set in the page. If <code>null</code>
	 * is passed, jdt default settings are used, or - if the project is an existing Java project - the
	 * classpath entries of the existing project
	 */	
	public void init(IJavaProject jproject, IPath outputLocation, IClasspathEntry[] classpathEntries) {
		fCurrJProject= jproject;
		boolean projectExists= false;
		List newClassPath= null;
		try {
			IProject project= fCurrJProject.getProject();
			projectExists= (project.exists() && project.getFile(".classpath").exists()); 
			if  (projectExists) {
				if (outputLocation == null) {
					outputLocation=  fCurrJProject.getOutputLocation();
				}
				if (classpathEntries == null) {
					classpathEntries=  fCurrJProject.getRawClasspath();
				}
			}
			if (outputLocation == null) {
				outputLocation= getDefaultBuildPath(jproject);
			}			
			if (classpathEntries != null) {
				newClassPath= getExistingEntries(classpathEntries);
			}