1

I've asked a lot of questions the last days, because I couldn't include a .jar-File in my android-project (working with ant).

Today, I switched the Java-Version of this Common-Project to 1.6 and created a new .jar-File.

And noooow, it works!!

Can someone tell me, why Android (2.2) doesn't support Java 1.7?

Thank you!

Gangnus
  • 24,044
  • 16
  • 90
  • 149
Frame91
  • 3,670
  • 8
  • 45
  • 89

2 Answers2

5

Because when Android 2.2 was created, there was no Java 1.7.

Compare http://en.wikipedia.org/wiki/Android_version_history against http://en.wikipedia.org/wiki/Java_version_history

Gangnus
  • 24,044
  • 16
  • 90
  • 149
  • @user1484047 - I don't see how it could have been less misleading. How is an old Android VM supposed to know that you are trying to use a Java 7 class when it doesn't know anything about Java 7?? – Stephen C Dec 14 '12 at 05:45
  • Well... I've marked some attempts as answers but I don't think that this should be normal behaviour... I've asked some very specific questions in ant and nobody had a solution for my problem... Okay, they were encouraged in helping me ;) I'll take a better look for this! Thank you again, you SOLVED my question ;) – Frame91 Dec 15 '12 at 00:14
  • It is not the worst. I have put here some really difficult questions - and as reactions, it happens, no answers at all and sometimes even minuses for the question. So, a real attempt to help is a good deed. – Gangnus Dec 15 '12 at 11:56
2

In addition to the timeline issue, there is also the issue that Android is not based on the Oracle Java codebase, and hence supporting Java 7 on Android is not simply a matter of porting existing code.

Indeed Java 7 adds a new bytecode, so that would entail a change to the Davlik VM to support it.

Community
  • 1
  • 1
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • So, nobody would rewrite the older Dalvik VMs, that is what you mean? – Gangnus Dec 13 '12 at 12:41
  • @Gangnus - well it is not the point I was trying to make ... but you are absolutely correct. Something as major as that is highly unlikely to be back-ported to Android releases. (And it is not in Google or the handset / tablet manufacturers' interest to do that work. They want to sell *new* stuff.) – Stephen C Dec 14 '12 at 02:03
  • yes. They don't support even *promised by them* Android OS upgrades (Asus Transformer, for example) – Gangnus Dec 14 '12 at 08:34