Community
Participate
Working Groups
M2 In 2.0 it was allowed to access IJavaProject.getOutputLocation/getRawClasspath on a project where the JavaNature was not set yet. Since 2.1 a JavaModelException is thrown if that happens. The new Java project wizard does this if a .classpath file is found at the location where the project will be created. I don't want to create a Java project right away to not have any java side effects (Java indexer) started until OK is pressed. Can we have this functionality back? A possibility would be to add an additional API 'JavaCore.getOutputLocation(File file) / getRawClasspath(File) where the file is the .classpath file.
In 2.0, this was a bug from our end, and it was causing other issues like fooling model updates etc... the project existency check is supposed to check for the nature. Not every project is a Java project, the nature tells us. Please investigate using internal Project#readClasspathFile(false, false) and then if ok, we will surface it as an API. This is a fair request, along the line of the #forceClasspathReload addition.
readClasspathFile is protected so I can't try that. But this looks like exactly what I need.
*** Bug 42247 has been marked as a duplicate of this bug. ***
Created attachment 5921 [details] Fix for PR 40658 Add two 2 new API methods on IJavaProject interface: readRawClasspath() readOutputLocation()
Philippe, I have attached the patch file which contains the 2 new API methods on IJavaProject to fix this problem. May you buddy check it and integrate if you're happy with this solution? Thanks
Patch works fine, integrated. Thanks for this first contribution.
Incorrectly assigned
Fixed
Verified.