title: Linux - default java version is 8, set 11 for Flutter
body: <p>On my developer machine:</p>
  <pre><code>[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
      • Android SDK at /home/michal/Android/Sdk
      • Platform android-31, build-tools 30.0.2
      • ANDROID_HOME = /home/michal/Android/Sdk
      • Java binary at: /home/michal/android/studio/jre/bin/java
      • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
      • All Android licenses accepted.
  </code></pre>
  <p>But global java version is Java 8:</p>
  <pre><code>java -version
  openjdk version &quot;1.8.0_265&quot;
  OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-1-b01)
  OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
  </code></pre>
  <p>It's somehow set by Android Studio. However, on my build server Flutter uses default 1.8 java version:</p>
  <pre><code>[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
      • Android SDK at /home/jenkins/Android/Sdk
      • Platform android-31, build-tools 30.0.2
      • ANDROID_HOME = /home/jenkins/Android/Sdk
      • Java binary at: /usr/bin/java
      • Java version OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2-b11)
      • All Android licenses accepted.
  </code></pre>
  <p>Thus, apps targeted to Android 12 fail to compile.</p>
  <p>How to set Java version to 11 (as on my dev machine is set) <strong>for Flutter only</strong>? System, default java version <strong>can't be changed</strong> I can't change JAVA_HOME variable or change default java version, it needs to be Java 8.</p>
  <p>I can't install Android Studio on build server, I need to figure out where configuration is actually stored.</p>
  <p>I guess I needd to set java binary path wihtout changing JAVA_HOME environment variable. Where to set it?</p>