I have the following code
IJavaProject targetProject = null;
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
for (IProject projec
The code in your answer shouldn't work (typo?). Here is how you can create an IJavaProject:
import org.eclipse.jdt.core.JavaCore
...
if (project.hasNature(JavaCore.NATURE_ID)) {
targetProject = JavaCore.create(project);
}
IProject
is a type in the Eclipse Resources API and IJavaProject is a type in the Eclipse Java Model. They are not the same abstractions, but all IJavaProjects have an IProject.