1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Flutter - IntelliJ IDEA can't find JAVA_HOME after executing flutter run after...

Discussão em 'Mobile' iniciado por Stack, Outubro 10, 2024 às 01:43.

  1. Stack

    Stack Membro Participativo

    I'm using M3 Pro Sequaoia. I got a flutter project, running flutter run I got this error

    ERROR: JAVA_HOME is set to an invalid directory: /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home

    Please set the JAVA_HOME variable in your environment to match the
    location of your Java installation.

    Error: Gradle task assembleDebug failed with exit code 1


    Running flutter doctor -v I got

    [​IMG]

    Running:

    zhelon@MacBook-Pro-M3-de-Sebastian-2 ~ % echo $JAVA_HOME


    Running:

    zhelon@MacBook-Pro-M3-de-Sebastian-2 ~ % which java
    /usr/bin/java


    Running:

    zhelon@MacBook-Pro-M3-de-Sebastian-2 ~ % java -version
    openjdk version "17.0.12" 2024-07-16
    OpenJDK Runtime Environment Homebrew (build 17.0.12+0)
    OpenJDK 64-Bit Server VM Homebrew (build 17.0.12+0, mixed mode, sharing)


    I just reinstalled intellij IDEA and Android Studio. This is my android sdk: [​IMG]

    .bash_profile

    # export PATH=”/opt/homebrew/opt/openjdk@17/bin:$HOME/.jenv/bin:$PATH:/Users/zhelon/development/flutter/bin”
    export PATH=”$PATH:/Users/zhelon/development/flutter/bin”

    # export JAVA_HOME=`/usr/libexec/java_home -v 17`
    export LANG=en_US.UTF-8
    export LANGUAGE=en_US.UTF-8
    export LC_ALL=en_US.UTF-8


    can I get some hand please?

    Continue reading...

Compartilhe esta Página