Create the javaProject, get the rawClasspath, then go through each entry and search for runtimeConatiner and the Plugin Container, remove those from raw list and then just add the raw list back to javaProject.