title: Android Studio compile project with Java 8?
body: <p>I'm trying to compile a project using java 8.</p>
  
  <p>I've set the correct jdk as shown in the image:</p>
  
  <p><a href="https://i.stack.imgur.com/hJSw7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hJSw7.png" alt="JDK location"></a></p>
  
  <p>Also changed the target version:</p>
  
  <p><a href="https://i.stack.imgur.com/gYOA3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gYOA3.png" alt="Target version"></a></p>
  
  <p>But I still got the error:
  <strong>compileSdkVersion 'android-24' requires JDK 1.8 or later to compile.</strong></p>
  
  <p>Where am I wrong?</p>
  
  <p>EDIT: I'm on Ubuntu 12.04</p>