Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

changing eclipse's java compiler to jdk7 [duplicate]

I'm trying to upgrade from jre6 and jdk6 to jre7 and jdk7. I program using eclipse, i downloaded and installed the jre7 and jdk7 on: C:\program files\java\ now when I enter eclipse i want to change the used compiler so i go to: window>preferences>java>compiler but there appears only 1.3,1.4,1.5 and 1.6 I've also entered: window>preferences>java>Installed JREs and added the jre7 version. But the compiler I can't change. how do I change my eclipse compiler?

like image 628
tomermes Avatar asked Nov 05 '11 18:11

tomermes


People also ask

How do I change the default compiler in eclipse?

To configure compiler compliance level and settings in eclipse, find the below steps. Step 2: Go to Java -> Compiler . Find the print screen. Step 4: To change default compliance settings, we need to uncheck Use default compliance settings and set the compiler java version for .

How do I add Java 1.7 compiler to eclipse?

To do this, right click your “cse331” folder and choose “Properties.” In the pane that appears, click on “Java Compiler” (not the drop-down menu, simply click on “Java Compiler”) and click the checkbox to “Enable project specific settings.” Then, under the “Compiler Compliance Level” change this from 1.8 to 1.7.


2 Answers

You need to upgrade to at least Eclipse Indigo SR1, which has been out for over a month. See also Eclipse announces full Java 7 support.

As evidence, here's a screen from my Indigo SR1 preferences:

enter image description here

And here's an example of executabele code snippet using diamond operator and ARM:

enter image description here

like image 99
BalusC Avatar answered Sep 25 '22 00:09

BalusC


You need a newer version of Eclipse. At least 3.7SR1.

like image 41
bmargulies Avatar answered Sep 26 '22 00:09

bmargulies