| Summary: | Compiler compliance level is limited to the java version that is used to run eclipse and sometimes shows 1.7 while it's still limited to 1.6 | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | John <M8R-sgiphk> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | markus.kell.r, pwebster |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
John
hey guys, I'm not sure what I changed meanwhile (at least added source/javadoc to the jdk7 pointing to the zip file), but now when using this eclipse.ini file -startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502 -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile -vmargs -Dfile.encoding=UTF-8 -Dosgi.requiredJavaVersion=1.5 -Xms128m -Xmx512m my eclipse runs in jdk7 (as before) but what's new now is that the warning is no longer shown (also found out where the warning is settable: Project->Properties->Java Compiler->Building->No strictly compatible JRE for execution environment available: Warning - maybe it's not this one, I just found it after I realized warning was gone) AND Project->Properties->Java Compiler-> Compiler compliance level now has 1.7 value (while previously was limited to 1.6) I'll try to figure out how this happened (In reply to comment #1) > Project->Properties->Java Compiler->Building->No strictly compatible JRE for > execution environment available: Warning - maybe it's not this one, I just > found it after I realized warning was gone) not that one, my bad, I meant this one(which is right above that): Incompatible required binaries: Warning ok, here's the thing, if Incompatible required binaries: is set to Warning I get 100 of 121 errors, and usually the warning for incompatible binaries was in the first 100, usually quite at the top, now it MAY be that it's between 101-121 but I tried setting Project->Properties->Maximum number of problems reported per compilation unit: 1001 now set to 200 (was initially 100, but was 1001 when I posted comment 2) but this has no effect, even after Project->Clean (and it autobuilds it) if this is a bug I'll report it separately... else it may be just me missing something (filters?) So it it possible that the warning is always reported, I just didn't see it in the first 100 of 121 warnings. Now if I do set `Incompatible required binaries:` to Error, then indeed I see it clearly and no matter the Compliance level setting (1.7 in both workspace and project - read below about how is this done) the Error is still reported. Maybe somewhere it's resetting it to 1.6 but it doesn't do that via the UI, or the UI value is not in sync. Whatever, what do I know?! ;) ----- Now about how come I can get compliance level 1.7 in Project->Properties, while before I could only get a maximum of 1.6, here's how it happens: [as a side: ok while doing this, I set Project's compliance level to 1.6 and set Incompatible required binaries: to Error and did a Project->Clean, and still didn't get the error (still got 100 of 121 warnings though) - ok this only had effect after I set the workspace setting to Error also and did a rebuild, I'll report more on this oddity later] For now, set both Project(->Properties) and Workspace (aka Window->Preferences) options for `Incompatible required binaries:` to Warning (but probably not required for this case:) do make sure Project->Properties->Java Compiler, `Enable project specific settings` is ticked/enabled and `Compiler compliance level` is set to 1.6 hit Ok check the workspace setting: Window->Preferences->Java->Compiler->Compiler compliance level is set to 1.7 ok, now go back to Project->Properties->Java Compiler observe the `Compiler compliance level` does not have an 1.7 option, untick/disable the `Enable project specific settings` hit ok now go back to where you were, Project->Properties observe the grayed out value is now 1.7 (previously was 1.6) and if you tick `Enable project specific settings` it remains 1.7 and is also in the list now (probably was forced due to workspace setting being at 1.7) you can hit ok now to save it now if you have more than 100 warnings like me, you might want to switch `Incompatible required binaries:` option to Errors, so you get 1 or 2 errors , one of which is the error we want to see, that is: the one with incompatible binaries bla bla... So you go in Project->Properties->Java Compiler->Building and set `Incompatible required binaries:` to Error hit ok and notice nothing happens, you still get only the warnings that were before (100 of 121 on my side) you can do a Project->Clean and let the autobuild rebuild it but it's the same Now you go to the same option in workspace Window->Preferences->Java->Compiler->Building and set `Incompatible required binaries:` to Error says something about a rebuild being needed and you say Yes and then ok hmm and still nothing happens (this should've worked, it did once before), still got no errors except 100 of 121 warnings wait this actually means that the 1.7 compliance is working? but since no warnings decreased it means my warning about incompatible binaries was probably not there from the beginning, hmm both workspace and project settings have the 200 as maximum number of reported problems and yet it's still limited to 100, maybe the combination of eclipse and jdk7 is cause this too I do an eclipse restart as it is now, and a Project->Clean, still only 100 or 121 warnings and no errors, ok fair enough let's try changing the workspace compliance level to 1.6 (nothing should happen, since project compliance level is at 1.7) indeed nothing happens but now I cannot set it back to 1.7 since 1.7 disappeared from list (and this in on Workspace settings, usually it disappears from Project settings) ok I lower the project compliance level to 1.6 press ok, does rebuild again, and still 100 of 121 warnings :) no errors I even do a Project->Clean I must be missing something, I did eclipse restart, still 1.7 option is not available in either workspace or project settings anymore, I stand to conclude that once I selected 1.6, the 1.7 is meant to be gone. I switched back to using the 1.6 java for running eclipse in. i get now 100 of 122 warnings (meanwhile I downgraded `Incompatible required binaries:` to Warning in both workspace and project settings) just for the kicks, setting this in project to Error, instantly reports it as Error (unlike what happens when running eclipse in jdk7) and it's also in the first 15 warnings in the list... Also the setting of 200 problems reported per compilation unit, still shows only 100... will check more on this, apparently it's a rather bad idea to run eclipse on jdk7, currently was jdk7 b142 may 12 2011 I'd guess it's not eclipse's fault, but rather eclipse+jdk7 in combination it is possible that I had the workspace compliance level set to 1.7 from a previous version of eclipse when eclipse allowed that, and that is why it showed in workspace in the first place, that is, when running eclipse with jdk7. Since I often import my saved preferences from before when I switch to a new version of eclipse. if this helps. Because now, once I set that workspace setting to 1.6 I cannot see the 1.7 anymore So it's basically not possible to select it anymore and now that I am running eclipse in jdk7 again, I see 100 of 122 warnings (means including the incompat. binaries one) and those settings for `Incompatible required binaries:` seem to work again when set to Error, it's instant. No more weirdness happening as it did in previous comment. Maybe the existence of the 1.7 setting fubared stuff around... I can probably restore the 1.7 setting if I import my config again but I'd rather not ==== to summarize, as far as I understand it, the 1.7 compliance level setting should never be shown(also based on what Paul told me on irc), if it's shown then set it to 1.6 (in both projects and workspace) and restart eclipse, else weird stuff happens with the settings (or at least the `Incompatible required binaries:` having no effect sometimes) and if my project uses jdk7 and I don't want to see the warning, then set to Ignore this setting: `Incompatible required binaries:`, well I don't really mind the warning so I'll allow it, especially that I know there's no 1.7 compliance yet ok, `Maximum number of problems reported per compilation unit` which was 100 was not the option I was looking for when trying to see more Warnings in the Problems View (was seeing 100 of 122), instead (thanks Paul) it's: click in the Problems view then press Ctrl+3 aka Quick access, then type Configure Contents there you see [] Use item limits Number of items visible per group: 100 I just restored (import) my preferences and gone to Window->Preferences and seen that indeed it set my compliance level to 1.7 , that is why this whole mess and bug report got to exist in the first place. And since as I understand it, eclipse tries to never allow compliance level above 1.6, having the 1.7 will cause all sorts of mess(more or less). Now, the 1.7 one appears both when running eclipse with jdk7 and when running it with jdk6. For some reason I thought it only appears when running jdk7(? I must've missed that somehow) thus to fix this I must manually change it to 1.6 and restart eclipse or just press Ok to never see 1.7 again I also saved (export) a new copy of my Preferences and hope this won't happen again Thanks and sorry, ... this should maybe be renamed to something like Importing your previous settings (which had compliance level 1.7 saved) will restore it and cause you to think it's supported, but do yourself a favor and set it to 1.6 then restart eclipse and see that 1.7 is not in the list It only shows 1.7 if you restored your Preferences via import (and also those preferences had to have 1.7 saved in them) Copied comment from the whiteboard: > read only Comment 6 (if unsure also read C. 4) Sorry for the inconvenience. In the beginning of the 3.7 cycle, we thought we could ship 3.7 with Java 7 support, so we enabled 1.7 compliance. But since the Java 7 specs have not been released yet, we had to revert this, see bug 321035. In the UI, you will still see 1.7 if the preference is already set to 1.7 (because you've set this in an earlier 3.7 build, or because you've imported preferences from such a build, or because you hacked the prefs file manually). Anyway, you won't get support for Java 7 features, but you can still run with a 1.7 JDK (just using 1.6 features). awesome! Thanks so much for expressing that so clearly! Much appreciated! |