| Summary: | project compiler compliance set to default does not not work with Java 7 | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Bob <bobbamme> | ||||||
| Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> | ||||||
| Status: | RESOLVED DUPLICATE | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | amj87.iitr, deepakazad, srikanth_sankaran | ||||||
| Version: | 3.7.1 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Bob
(In reply to comment #0) > Build Identifier: M20110909-1335 > > I have the Java SE7 SDK installed and in eclipse I have the compiler compliance > level set to 1.7. I made a new java project with the setting to use the > default JRE. After writing some simple code, it is apparent that eclipse isn't > recognizing features like generics and the enum keyword. > > In the project settings, if I enable project specific settings for the java > compiler and set that to 1.7 everything works. For some reason, when I have > project specific settings disabled the project uses something lower than 1.5 > even though the default is 1.7. What is the source compatibility level when you get the problems ? This needs to be 1.7 too if you want to use 1.7 specific features and at least 1.5 if you want to use enum and generics. The source level is the control for language features. The compliance level simply instructs eclipse to match certain idiosyncracies that javac is known to exhibit at each level. Bob, please make sure you follow these steps: 1) When you select the default compliance to 1.7, please "check" the "use default compliance settings" checkbox. 2) If the above is not checked, please make sure the "Source compatibility" is set to 1.7 as well. (In reply to comment #2) > Bob, please make sure you follow these steps: > 1) When you select the default compliance to 1.7, please "check" the "use > default compliance settings" checkbox. > 2) If the above is not checked, please make sure the "Source compatibility" is > set to 1.7 as well. Dear Srikanth and Ayushman, I do have the "use default compliance settings" option checked. Moreover, the source compatibility is listed as 1.7 (the drop down box for this option is disabled of course because I am using the default compliance settings). I can provide some screen shots if that would be of assistance to you. I still cannot reproduce this. :( Can you try this on a fresh workspace? Maybe there's something in your workspace that's causing the issue. Thanks. Could bug 349697 be related/similar to this ? (In reply to comment #5) > Could bug 349697 be related/similar to this ? Bob, can you report if your symptoms look the same? Also please report what all plugins you have installed over Eclipse. Thanks! Created attachment 206560 [details]
New project warning message with global compiler settings
Created attachment 206561 [details] Project compiler settings similar to those in bug 349697 (In reply to comment #8) > Created attachment 206561 [details] > Project compiler settings similar to those in bug 349697 I made a new workspace and did not encounter the problem. The bug does appear to be associated with my workspace. I noticed this message when I was making a new Java project in the problematic workspace "The current workspace uses a 1.7 JRE with compiler compliance level 1.4. This is not recommended and either the JRE or the compiler compliance level should be changed." Following this message is a hyperlink called "Configure..." which opens the global Java compiler settings. However, the settings are set to 1.7 and not 1.4 so obviously there is some miscommunication within the program. I have included a screen shot that illustrates this contradiction. The symptoms of bug 349697 are very similar to what I am experiencing. I would tentatively say that they are the same bug. I have uploaded a second image that shows odd project compiler settings (which nevertheless should not be active because project specific settings are not enabled) of similar nature to those in the screenshot from bug 349697. Regarding my plugins, I added the EGit, Google GWT, and Google Android plugins. Screenshots confirm the same issue as bug 349697. Thanks Bob and Deepak! *** This bug has been marked as a duplicate of bug 349697 *** |