Do Android Developers Tools support JAVA 7 API up to this date? I'm trying to build an Android app using JAVA 7 and I was wondering about this thing.
Asked
Active
Viewed 2.0k times
35
-
13Java 7 is now [officially supported](http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Using-sourceCompatibility-1.7). To the mods @tuxdude - what exactly is not a real question here? It is a very precise and very relevant and real question that keeps many busy (think e.g of compatibility to external jar files), and since the question's closed we cannot update it to the current status. – Bachi Jan 29 '14 at 14:50
-
Agreed. Very ignorant to say this is not a real question. Very, very, very ignorant of the Android landscape. Not only is this a real question, there are significant levels of complexity to this question. – TimJowers2 Mar 25 '15 at 14:51
-
Mods please reopen this question – Krypton Jan 05 '16 at 10:24
2 Answers
32
While you can write code in Java 7, the Android Systems that run it only support upto Java 6, so 7 features like switch-case on Strings fail.
As of Build tools 19, Java 7 is now supported.

Raghav Sood
- 81,899
- 22
- 187
- 195
-
Could you elaborate the `==` comparison remark? From what I understand, using the `==` operator on Strings succeeds on Java 6 as well as Java 7: it returns true if they are the same instance, and false otherwise. – pimmhogeling Jun 09 '13 at 20:52
-
@pimmhogeling It compares the memory address of the objects, not their values. So if you have two different strings that both have the same value, it will return false. equals() compares the value. – Raghav Sood Jun 10 '13 at 02:08
-
Yes, exactly as I would expect it to work. But it works that way on both Java 6 and Java 7, doesn't it? – pimmhogeling Jun 11 '13 at 12:32
-
-
The Java 7 book by Jay Bryant (1430236868 or 9781430236863) explicitly says == compares the instances (page 63). On the other hand, I found different people around the web who say you are correct. Is this clarified in a spec somewhere? – pimmhogeling Jun 11 '13 at 21:25
-
3[It's now supported](http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Using-sourceCompatibility-1.7)! – Takhion Nov 12 '13 at 14:34
-
3
-
2[Java 7 language features are now supported by Eclipse ADT](https://developer.android.com/tools/sdk/eclipse-adt.html#notes) as well (as of March) – kassim Mar 16 '14 at 13:23
-
5
No, the android documentation is pretty clear about this. Only Java 6.
Also, be sure to download the Oracle JDK 6 (the Java Runtime is not sufficient).

Stephan Branczyk
- 9,363
- 2
- 33
- 49