๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ“ฑ|APP DEV/Flutter

[Flutter] Android Studio Unable to find bundled Java version ์˜ค๋ฅ˜(Mac ํ™˜๊ฒฝ)

by KASSID 2023. 1. 18.

๋ชฉ์ฐจ

    728x90

    ๋ฌธ์ œ

    ํ”Œ๋Ÿฌํ„ฐ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ๊ตฌ์ถ• ์‹œ Android Studio๊ฐ€ ํ•„์š”ํ•˜๋‹ค.

    flutter doctor๋ฅผ ํ†ตํ•ด ์ง„๋‹จ์„ ํ•œ ๊ฒฐ๊ณผ

    ์œ„์™€ ๊ฐ™์€ ์—๋Ÿฌ ๋ฉ”์„ธ์ง€๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค.

     

    ํ•ด๊ฒฐ๋ฒ•

    1. Java Path ํ™•์ธ

    ๋จผ์ € command + shift + . ์œผ๋กœ ์ˆจ๊น€ ํŒŒ์ผ์„ ๋ณด์ด๊ฒŒ ํ•œ ๋’ค

    .zshrc์—์„œ 

    export JAVA_HOME=$(/usr/libexec/java_home)๋ฅผ ํ™•์ธํ•œ๋‹ค.

    ์—†์„ ๊ฒฝ์šฐ ์•„๋ž˜์˜ ์ฝ”๋“œ๋ฅผ ํ„ฐ๋ฏธ๋„์— ์ž…๋ ฅํ•˜์—ฌ ๊ฒฝ๋กœ๋ฅผ ์ˆ˜์ •ํ•œ๋‹ค.

    echo 'export JAVA_HOME=$(/usr/libexec/java_home)"' >> ~/.zshrc && source ~/.zshrc

     

    2. ์•„๋ž˜์˜ ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•˜์—ฌ jbrํด๋”์— ์ปจํ…์ธ  ์ƒ์„ฑ

    cd /Applications/Android\ Studio.app/Contents/jbr
    ln -s ../jbr jdk
    ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

     

    3. Android Studio ์•ฑ์—์„œ ํŒจํ‚ค์ง€ ๋‚ด์šฉ์„ ํ™•์ธ

     

    4. Contents ํด๋”์—์„œ 'jre' ํด๋”๋ฅผ ์ƒ์„ฑ

     

    5. jbr ํด๋”์˜ ๋ชจ๋“  ์ปจํ…์ธ ๋ฅผ jre ํด๋”๋กœ ๋ณต์‚ฌ ๋ถ™์—ฌ๋„ฃ๊ธฐ

     

    6. ํ™•์ธ

    flutter doctor

    ์œ„์˜ ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•ด ์ž˜ ํ•ด๊ฒฐ์ด ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•œ๋‹ค.

     

    ํ•ด๊ฒฐ์ด ๋œ ๊ฒฝ์šฐ์˜ ์‚ฌ์ง„

     

    ๋Œ“๊ธ€