Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><em>EDIT: At the time this was written, the latest release was Android 9 and Eclipse Indigo. Thing have changed since then.</em></p> <ul> <li><strong>Practical answer</strong></li> </ul> <p>Yes, I have tried. But this is not a great test as the compatibility was limited to level 6 with no way (no simple way at least) to really use java 7:</p> <ul> <li>First I installed a JDK7 on a machine that had no other JDK installed - Eclipse and Android are not installed either:</li> </ul> <p><img src="https://i.stack.imgur.com/SVTUO.png" alt="The 7 is the only installed on this machine"></p> <ul> <li>Then I installed a brand new Eclipse Indigo and checked it was actually using the JDK 7 (well, as this is the only one and as this is the one I've selected I would have been surprised)</li> </ul> <p><img src="https://i.stack.imgur.com/EEL6y.png" alt="The 7 is the only used by this Eclipse"></p> <ul> <li><p>Then I installed the latest version of the Android SDK (EDIT: Honeycomb, API13, at the time this post was written). It found my JDK 7 and installed properly. The same for ADT.</p></li> <li><p>But I had a surprise when trying to compile and run a Hello Word Android app. The compatibility was set to Java 6 with no way to force it to Java 7:</p></li> </ul> <p><img src="https://i.stack.imgur.com/Vhia8.png" alt="Compatibility is limited to Java 6"></p> <ul> <li>I tried with a non-Android project, a regular Java one, and I had the explanation. The compatibility level seems to be limited by Eclipse (see the message at bottom of the following image):</li> </ul> <p><img src="https://i.stack.imgur.com/uFoI7.png" alt="Eclipse limits itself to level 6 compatibility"></p> <p>So I had <em>Hello World</em> working, and also other apps, more complicated and using <code>SQLite</code>, <code>Listview</code>, <code>Sensor</code> and <code>Camera</code>, but this only proves that the compatibility handling of Java 7 seems to be well done and working with Android.</p> <p><strong>So, did someone try with the good old Ant, to bypass the Eclipse limitation seen above?</strong></p> <ul> <li><strong>Theroetical answer</strong></li> </ul> <p>Anyway, the SDK is designed to be used with Java 5 or 6, as explained <a href="http://developer.android.com/sdk/requirements.html" rel="nofollow noreferrer">here</a>.</p> <p>We may have something working with Java 7, but it would be working "by accident". The building of the DEX may work properly or not, and once the DEX built, it may work or not. This because using a non-qualified JDK gives unpredictable results by definition.</p> <p>Even if someone has succesfully built an Android app under plain Java 7, this does not qualify the JDK. The same process applied to another application may fail, or the resulting application may have bugs tied to the use of that JDK. Not recommended.</p> <p>For those who are involved on webapps development, this exactly the same as deploying a web application built under Java 5 or 6 under an application server qualified for Java 4 only (let's say Weblogic 8 for example). This may work, but this is not something that can be recommended for other purposes than trying.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload