Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350319 - [1.7] Default EE for project is 1.6 even though my only JRE is 1.7
Summary: [1.7] Default EE for project is 1.6 even though my only JRE is 1.7
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-24 14:51 EDT by Curtis Windatt CLA
Modified: 2011-07-11 04:05 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2011-06-24 14:51:26 EDT
In NewJavaProjectWizard#getDefaultEEName() the last line of code returns "JavaSE-1.6" as the default EE to select for new projects.

When self-hosting with the Sun 1.7 JRE (that is the only JRE available to JDT), I try to create a new java project.  The default JRE setting is to use the 1.6.  This seems incorrect as I must change the project properties as soon as I start using Java 7 structures.

If the default EE is supposed to be the highest available, the method should be updated to reflect that.  Alternatively, perhaps we can improve the code at line 583 to match better.  Currently it checks to see if a default VM is set for any of the execution environments that match the default vm install.  We could also check to see an EE is a 'perfect match' to the default vm install.
Comment 1 Dani Megert CLA 2011-07-04 10:59:34 EDT
This works fine for me. Make sure you have all relevant projects in your install. It looks like the org.eclipse.osgi is not the one needed for Java 7.

If this is not the case then please reopen with more detailed steps to reproduce.
Comment 2 Curtis Windatt CLA 2011-07-07 16:38:23 EDT
I can still see this using the N20110707-1400 build from the Java 7 branch.

Steps:
1) Download the build from the Java 7 build site
2) Launch Eclipse with the vm argument pointing to a Sun 1.7 VM
3) Select a new folder for your workspace (clean workspace)
4) File > New > Java Project
Result:
Default JRE setting is stil JavaSE-1.6

Debugging the same steps shows that the last line of getDefaultEEName() inside NewJavaProjectWizardPageOne.java is getting hit which returns the string "JavaSE-1.6".
Comment 3 Dani Megert CLA 2011-07-11 04:05:00 EDT
>1) Download the build from the Java 7 build site
There is no official site with Java 7 builds. I have no clue where you got N20110707-1400.

You have two official ways:
1)
1. download R3.7 or R4.1
2. start new workspace
3. install Java 7 support, see:
   http://wiki.eclipse.org/JDT/Eclipse_Java_7_Support_%28BETA%29
4. restart with a new workspace using a Java 7 JRE
5. create a Java project

2)
1. have a workspace (e.g. from a 3.7 target)
2. load Java 7 support from CVS, for details see:
   http://wiki.eclipse.org/JDT_Core/Java7#What_to_do_to_set_up_the_IDE
3. start a target workspace with a Java 7 JRE
4. create a new Java project in the target

I just tried both scenarios again and it works fine for me.

If you still see this then please provide more detailed steps on how to reproduce the problem.