1

I have seen multiple post to resolve this issue. But according to my scenario whenever I create new android project. It shows me error R can not be resolved. Previously i was used JDK1.6 then it works fine. Currently I shift to jdk1.7. Now what I do for this. I am using window 7 64 bit PC.

To resolve this I checked my environment variables that is fine, do fix project properties its also fine

Thanks for your help

hoss
  • 2,430
  • 1
  • 27
  • 42
Amit Thaper
  • 2,117
  • 4
  • 26
  • 49

3 Answers3

3

Android SDK works with JDK1.6. You should switch back to using it.

Developer
  • 144
  • 11
dors
  • 5,802
  • 8
  • 45
  • 71
  • 2
    Is there any reason why we not use JDK1.7? – Amit Thaper Jun 28 '13 at 07:17
  • @AndroidDeveloper : **"Is there any reason why we not use JDK1.7?"** - Yes there's a reason. It's because it breaks Android development (as you have already discovered) if you're using Eclipse. If you want to use JDK 1.7 then you'll need to use other dev tools. – Squonk Jun 28 '13 at 07:47
  • Now i replace JDK with 1.6. Same issue displayed – Amit Thaper Jun 28 '13 at 09:04
0

If you're using Eclipse, you are stuck with Java 1.5 and Java 1.6, since its hardcoded into the Eclipse ADT.

It seems however, that you can use IntelliJ (and thus maybe the new Android Studio?) with higher Java versions just fine; Java 7 language features with Android

Community
  • 1
  • 1
Stefan de Bruijn
  • 6,289
  • 2
  • 23
  • 31
0

If you are using eclipse, goto menu Window -> Preferences. In preference editor,Click on Java -> Compiler (submenu in java). Then you will see an option called "Java Compliance, Complier compliance level". Click on the dropdown menu right to it and change the java version to 1.6.

Sreejith B Naick
  • 1,203
  • 7
  • 13