Community
Participate
Working Groups
Created attachment 207311 [details] Screen shot When I check out org.eclipse.edt.rui.samples_0.7.0 sample, there's always the following error: Project 'org.eclipse.edt.rui.samples_0.7.0' is missing required source folder: 'generatedJava' org.eclipse.edt.rui.samples_0.7.0 This should be fixed before the sample is made available on Eclipse. It's confusing because it looks like the missing folder is there. Screen shot attached.
Does this happen with any other EDT projects when they are imported, or is it specific to the samples project?
Subscribe Justin. I thought this was discussed some time ago. A java source folder, if empty, is not recreated when you export & import again. (same when you checkout from CVS). JDT will look for the java source folder, and give an error if it is not found.
The default behavior of CVS checkout in Eclipse is to prune empty directories. This means empty source folders will not be checked out and JDT will create a build path error marker. You can change this behavior in preferences > Team > CVS > Files and Folders > Prune empty directories We'd have to put some placeholder.txt file in the directory to prevent such errors from happening out of the box.
Not that I see. It has generatedJava in the Java Build Path properties. I just remove it and the error goes away.
I have seen this as well. It seems to be a race condition between when JDT checks for classpath folders and when the EDT Gen Builder creates the folder. If you check the project out of CVS, that folder (generateJava) does not exist, but it is created when the EDT Build runs. Once the error appears, a clean build will resolve the issue, but I would expect the creation of the folder by the EDT builder to resolve the issue.
I am deferring this until after .7. The workaround is easy (clean the project), and for our samples we can ship the directories with a temporary file in them so that they are not deleted during export.
This is related to the IDE Core, and could happen with any project.
Hi, Brian I will add the temp files in the generatedJava folder of the sample project. Do we have a sample list we should consider other then org.eclipse.edt.rui.samples_0.7.0?
I am aware of the need to add temporary files in most situations, where the Java Source folder is not created because it contains no files, but in this situation, the generatedJava folder IS created by the IDE during import, and there is still an error message. I would like to know why there is still an error message, even when the generatedJava folder still exists. Adding the file would resolve this particular issue, but it would just hide the original problem.
Hi Brian I did a test, the generatedJava folder will not auto created when import from CVS
I tried this again, and I am still seeing the same problem as shown in the original screen capture. I am using Eclipse 3.6 with the latest development code from CVS. Autobuild is enabled in my workspace. When I checkout the project, the generatedJava folder is created, with .java files in the folder, but I have the following error on the project: 'org.eclipse.edt.rui.samples_0.7.0' is missing required source folder: 'generatedJava' Justin, can you try this in your workspace and see what results you get?
If you put a breakpoint in JavaProject.createClasspathProblemMarker() you'll see that a resource change processor runs a classpath check on PRE_BUILD. Initially there *is* a build path problem so it reports it, however our GenerationBuilder fixes it by creating the missing folder. A fix might be to get the Java project to refresh its classpath error state.
This defect is blocked by 371046 now, the generatedJava folder will not be generated even you create a basic EDT project.
fixed
The latest fix removed all Java build path markers whenever we attempt to add the generation directory to the class path of the project. There are ways to have JDT update their own markers, without deleting them (i.e. JavaProject.resolveClassPath(), etc). Also, this fix would remove legitimate markers for build path entries that were not being added by EDT. Deferring to I3.
Created attachment 211708 [details] fix
Hi, Brian I did an investigation of JavaProject, try to find out how to refresh the class path error. But it is hard to use the methods in JavaProject because it is private, we can not use them out of JDT. So I did a modify of my previous fix, add a judgement of the marker message, so that it can make sure it only remove the marker we want. Please help to review the patch, thanks
I have a question. Is deleting the marker all that's needed here, or do we need to do something like kick off an incremental build so that the Java builder can compile the source files (it would have aborted the previous compilation due to the build path error)?
Hi, Justin I think we don't not need to kick off an incremental build at this time, all we need is to delete the wrong marker so that the Java Builder can kick of a build after the java code generated.
Hi, if no more question, I will check in the code tomorrow.
Created attachment 211928 [details] EDT Project Marker Patch Attached is a patch that I would prefer we use. Instead of deleting the markers from the project, the classpath is forced to update if the classpath has not been modified, yet the java source directory has just been created.
use Brian's fix to solve the problem
closing