You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Gradle: Use Java bundled with Android Studio #8515
The Gradle-based build process currently requires either JAVA_HOME to be set or that java is in your path. It would be nice if Gradle could just use the Java version that comes bundled with Android Studio (C:\Program Files\Android\Android Studio\jre).
Especially on platforms that don't ship with java by default (e.g. Windows), that would simplify the setup instructions to get started (e.i. remove the need to download and install stand-alone Java).
On Wed, Mar 1, 2017, 4:13 PM Michael Goderbauer ***@***.***> wrote:
The Gradle-based build process currently requires either JAVA_HOME to be
set or that java is in your path. It would be nice if Gradle could just
use the Java version that comes bundled with Android Studio (C:\Program
Files\Android\Android Studio\jre).
Especially on platforms that don't ship with java by default (e.g.
Windows), that would simplify the setup instructions to get started (e.i.
remove the need to download and install stand-alone Java).
/cc @jakobr-google <https://github.com/jakobr-google> @mit-mit
<https://github.com/mit-mit>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8515>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAVZ6Lt5R4KDopVnoqmTUPHjYABnffJks5rhgmmgaJpZM4MQYYV>
.
Currently, people on Windows need to do one of the following:
Download and install the ~200MB Java run-time from Oracle after accepting Oracle's License Agreement, or
Add the Java version bundled with Android Studio to their PATH (a multi-step process on Windows).
If Flutter were smart enough to just use the bundled Java version, we could skip those steps. With less setup steps, there are fewer chances for miss-configuration, and people can get started quicker with writing apps!
That would be super nice, yeah. It's actually the version of Gradle that's bundled with Android Studio that requires Java (and apparently doesn't think to look in the jre directory right next to itself...).
We could get Flutter Tools to detect this situation and set JAVA_HOME when calling Gradle.
I just verified this under Windows: when I uninstall stand-alone Java and manually set my JAVA_HOME to the bundled JRE directory, flutter works still as expected.
Hello,
Is it hard-coded in flutter to use Java bundled with Android Studio or can I change it to my JDK installation? I have my JAVA_HOME correctly setup and when I run java -version, it reports the version from my JDK installation, but flutter always uses the Java bundled with Android Studio even though it is not in my PATH and even when running from Powershell or Visual Studio Code. Is there anyway that I can tell flutter to use the JDK version of Java?
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
sethladd commentedon Mar 2, 2017
goderbauer commentedon Mar 2, 2017
Currently, people on Windows need to do one of the following:
If Flutter were smart enough to just use the bundled Java version, we could skip those steps. With less setup steps, there are fewer chances for miss-configuration, and people can get started quicker with writing apps!
jakobr-google commentedon Mar 2, 2017
That would be super nice, yeah. It's actually the version of Gradle that's bundled with Android Studio that requires Java (and apparently doesn't think to look in the jre directory right next to itself...).
We could get Flutter Tools to detect this situation and set JAVA_HOME when calling Gradle.
goderbauer commentedon Mar 2, 2017
I just verified this under Windows: when I uninstall stand-alone Java and manually set my JAVA_HOME to the bundled JRE directory, flutter works still as expected.
mit-mit commentedon Mar 3, 2017
Sounds really nice if we could get rid of that extra install!
Monster-Gaming-Studios commentedon Aug 15, 2020
Hello,
Is it hard-coded in flutter to use Java bundled with Android Studio or can I change it to my JDK installation? I have my
JAVA_HOMEcorrectly setup and when I runjava -version, it reports the version from my JDK installation, but flutter always uses the Java bundled with Android Studio even though it is not in myPATHand even when running from Powershell or Visual Studio Code. Is there anyway that I can tell flutter to use the JDK version of Java?Thanks.
github-actions commentedon Aug 17, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.