title: Gradle, "sourceCompatibility" vs "targetCompatibility"?
body: <p>What is the relationship/difference between <code>sourceCompatibility</code> and <code>targetCompatibility</code>? What happens when they are set to different values?</p>
  
  <p>According to <a href="http://www.gradle.org/docs/current/userguide/java_plugin.html" rel="noreferrer">Gradle documentation</a>:</p>
  
  <p><code>sourceCompatibility</code> is "Java version compatibility to use when compiling Java source."
  <code>targetCompatibility</code> is "Java version to generate classes for."</p>
  
  <p>My understanding is that <code>targetCompatibility</code> will generate java bytecode that is compatible with a specific version of Java, is this a subset of the functionality of <code>sourceCompatibility</code>?</p>