Community
Participate
Working Groups
Steps to reproduce: 1. Create a Java7 project 2. Paste int a = 1_0; into the package explorer 3. Just Change the compiler compliance to 1.6 project 4. There will be an error and a quick fix to change the compliance 5. Apply the quick fix and notice that the class files are not really build.
Can reproduce: the compliance gets changed but no build happens. Maybe because the JRE was already 1.7. Probably caused by fix for bug 199616. Also note: the quick fix did not suggest to change the EE (as requested by bug 199616) but to set project compliance and JRE.
I see a similar problem when I use diamond with 1.4 package p; import java.util.ArrayList; public class C { public static void main(String[] args) { new ArrayList<>(); } } 1) Remove JRE 1.7 from the list of added JREs , set the EE to 1.4 2) Invoke quick fix 'Change Project compliance and JRE to 1.7' --> I see errors due to unbound JavaSE-1.7 added to build path: The project cannot be built until build path errors are resolved _pasted_code_ Unknown Java Problem Unbound classpath container: 'JRE System Library [JavaSE-1.7]' in project '_pasted_code_' _pasted_code_ Build path Build Path Problem
I also ran into this while testing switching on strings in 1.6 mode. (yes I had a JDK7 JRE). I hovered on some of the error markers and caused the error message "Cannot switch on ..." to appear in the status bar (bottom of screen) Having done that I happened to do a clean & rebuild. This clears all the error markers, but leaves the status line still showing the error message "Cannot switch on ..."
*** Bug 352547 has been marked as a duplicate of this bug. ***
Created attachment 200459 [details] Fix The patch fixes 2 problems: 1. We need to trigger a build if we just changed the compiler compliance but didn't touch the classpath. 2. The additional info didn't tell that the quick fix updates the project JRE if the fix only changed the classpath entry but didn't change the actual VM install that ended up on the classpath (this e.g. happens when you only have a 1.7 JRE installed and the quick fix changes the EE on the classpath from JavaSE-1.6 to JavaSE-1.7).
Fixed in BETA_JAVA7.
Verified in I20110729-1200 and M20110729-1400.