Environment variable issue when Launching Android Studio using GUI Application Launcher

Hello everyone,

I'm new here and recently installed this distro . All good so far but having trouble in setting JAVA_HOME and other android related variable correctly.

When Launching Android Studio from Konsole everything works fine all of variable works.
I exported all variable into ~/.fish_profile and ~/.config/fish/config.fish.

But problem only happen when i launch studio from Application Launcher menu, then it says JAVA_HOME not found .

Any help will be appreciated . I'm newbie and kinda stuck and searched i lot before posting this thread.

Possible solution link but i tried this also its not working in my case since this solution is for who is using GNOME. [JAVA_HOME issue with Android Studio · Issue #91 · runningcode/gradle-doctor · GitHub](https://JAVA_HOME issue with Android Studio)

Welcome :slight_smile:


Hello Garuda users.

Please read the following template before requesting assistance:

Please post the terminal/konsole input and output as text (no pictures) from the following command:


Refusing to post the output of the required "garuda-inxi" on a help request will likely result in you not receiving any help from the Garuda team. A failure to provide your system specs may also result in your thread being closed without notice, (as without this information providing assistance is often next to impossible).

Before opening a new help request, please search the Arch and Garuda Wiki's, and read any relevant sections related to your issue. Also, thoroughly search any error messages in the forum's search engine and on the web. For in depth information on how to search for answers to Linux issues effectively read the tips on the Garuda Wiki:

Please report in detail everything you have already attempted to solve your problem.

The template above should be deleted before posting your help request.


Input: sudo garuda-inxi

Output: System:
Kernel: 6.1.6-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=10ce8b0a-e683-430c-a81f-d2a69f0b9938 rw [email protected]
quiet quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
loglevel=3 ibt=off
Desktop: KDE Plasma v: 5.26.5 tk: Qt v: 5.15.8 info: latte-dock
wm: kwin_x11 dm: SDDM Distro: Garuda Linux base: Arch Linux
Type: Desktop System: ASUS product: N/A v: N/A serial: N/A
Mobo: ASUSTeK model: ROG STRIX B550-F GAMING (WI-FI) v: Rev X.0x
serial: <filter> UEFI: American Megatrends v: 2806 date: 10/27/2022
Info: model: AMD Ryzen 9 3900X socket: AM4 bits: 64 type: MT MCP arch: Zen 2
gen: 3 level: v3 note: check built: 2020-22 process: TSMC n7 (7nm)
family: 0x17 (23) model-id: 0x71 (113) stepping: 0 microcode: 0x8701021
Topology: cpus: 1x cores: 12 tpc: 2 threads: 24 smt: enabled cache:
L1: 768 KiB desc: d-12x32 KiB; i-12x32 KiB L2: 6 MiB desc: 12x512 KiB
L3: 64 MiB desc: 4x16 MiB
Speed (MHz): avg: 3800 min/max: 2200/4672 boost: enabled
base/boost: 3800/4650 scaling: driver: acpi-cpufreq governor: performance
volts: 1.1 V ext-clock: 100 MHz cores: 1: 3800 2: 3800 3: 3800 4: 3800
5: 3800 6: 3800 7: 3800 8: 3800 9: 3800 10: 3800 11: 3800 12: 3800
13: 3800 14: 3800 15: 3800 16: 3800 17: 3800 18: 3800 19: 3800 20: 3800
21: 3800 22: 3800 23: 3800 24: 3800 bogomips: 182403
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Vulnerabilities: <filter>
Device-1: NVIDIA TU106 [GeForce RTX 2060 SUPER] driver: nvidia v: 525.78.01
alternate: nouveau,nvidia_drm non-free: 525.xx+
status: current (as of 2022-12) arch: Turing code: TUxxx
process: TSMC 12nm FF built: 2018-22 pcie: gen: 3 speed: 8 GT/s lanes: 16
bus-ID: 08:00.0 chip-ID: 10de:1f06 class-ID: 0300
Display: x11 server: X.Org v: 21.1.6 with: Xwayland v: 22.1.7
compositor: kwin_x11 driver: N/A display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 81 s-size: 602x343mm (23.70x13.50")
s-diag: 693mm (27.28")
Monitor-1: HDMI-0 res: 1920x1080 hz: 144 dpi: 82
size: 598x336mm (23.54x13.23") diag: 686mm (27.01") modes: N/A
API: OpenGL v: 4.6.0 NVIDIA 525.78.01 renderer: NVIDIA GeForce RTX 2060
SUPER/PCIe/SSE2 direct render: Yes
Device-1: NVIDIA TU106 High Definition Audio driver: snd_hda_intel v: kernel
pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 08:00.1 chip-ID: 10de:10f9
class-ID: 0403
Device-2: AMD Starship/Matisse HD Audio vendor: ASUSTeK
driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
bus-ID: 0a:00.4 chip-ID: 1022:1487 class-ID: 0403
Sound API: ALSA v: k6.1.6-zen1-1-zen running: yes
Sound Server-1: PulseAudio v: 16.1 running: no
Sound Server-2: PipeWire v: 0.3.64 running: yes
Device-1: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel pcie: gen: 2
speed: 5 GT/s lanes: 1 bus-ID: 06:00.0 chip-ID: 8086:2723 class-ID: 0280
IF: wlp6s0 state: up mac: <filter>
Device-2: Intel Ethernet I225-V vendor: ASUSTeK driver: igc v: kernel
pcie: gen: 2 speed: 5 GT/s lanes: 1 port: N/A bus-ID: 07:00.0
chip-ID: 8086:15f3 class-ID: 0200
IF: enp7s0 state: down mac: <filter>
Device-1: Intel AX200 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 1-5:2
chip-ID: 8087:0029 class-ID: e001
Report: bt-adapter ID: hci0 rfk-id: 1 state: up address: <filter>
Local Storage: total: 1.02 TiB used: 70.67 GiB (6.8%)
ID-1: /dev/nvme0n1 maj-min: 259:5 vendor: Crucial model: CT500P5PSSD8
size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
lanes: 4 type: SSD serial: <filter> rev: P7CR403 temp: 37.9 C scheme: GPT
SMART: yes health: PASSED on: 8 hrs cycles: 39
read-units: 970,480 [496 GB] written-units: 2,123,252 [1.08 TB]
ID-2: /dev/nvme1n1 maj-min: 259:0 vendor: Samsung
model: SSD 970 EVO Plus 500GB size: 465.76 GiB block-size: physical: 512 B
logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
rev: 2B2QEXM7 temp: 28.9 C scheme: GPT
SMART: yes health: PASSED on: 159d 13h cycles: 2,061
read-units: 65,910,467 [33.7 TB] written-units: 62,646,627 [32.0 TB]
ID-3: /dev/sda maj-min: 8:0 vendor: Crucial model: CT120BX500SSD1
family: Micron Client SSDs size: 111.79 GiB block-size: physical: 512 B
logical: 512 B sata: 3.2 speed: 6.0 Gb/s type: SSD serial: <filter>
rev: R013 temp: 29 C scheme: GPT
SMART: yes state: enabled health: PASSED on: 167d 15h cycles: 1753
written: 1.45 TiB
ID-1: / raw-size: 111.5 GiB size: 111.5 GiB (100.00%)
used: 70.67 GiB (63.4%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p3
maj-min: 259:8
ID-2: /boot/efi raw-size: 512 MiB size: 511 MiB (99.80%)
used: 612 KiB (0.1%) fs: vfat block-size: 512 B dev: /dev/nvme0n1p1
maj-min: 259:6
ID-3: /home raw-size: 111.5 GiB size: 111.5 GiB (100.00%)
used: 70.67 GiB (63.4%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p3
maj-min: 259:8
ID-4: /var/log raw-size: 111.5 GiB size: 111.5 GiB (100.00%)
used: 70.67 GiB (63.4%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p3
maj-min: 259:8
ID-5: /var/tmp raw-size: 111.5 GiB size: 111.5 GiB (100.00%)
used: 70.67 GiB (63.4%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p3
maj-min: 259:8
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 31.25 GiB used: 512 KiB (0.0%) priority: 100
dev: /dev/zram0
ID-2: swap-2 type: partition size: 8 GiB used: 0 KiB (0.0%) priority: -2
dev: /dev/nvme0n1p2 maj-min: 259:7
System Temperatures: cpu: 43.0 C mobo: N/A gpu: nvidia temp: 44 C
Fan Speeds (RPM): N/A gpu: nvidia fan: 0%
Processes: 422 Uptime: 13m wakeups: 0 Memory: 31.25 GiB
used: 3.55 GiB (11.4%) Init: systemd v: 252 default: graphical
tool: systemctl Compilers: gcc: 12.2.0 clang: 14.0.6 Packages: pm: pacman
pkgs: 1377 libs: 323 tools: gnome-software,octopi,pamac,paru
Shell: garuda-inxi (sudo) default: Bash v: 5.1.16 running-in: konsole
inxi: 3.3.24
Garuda (2.6.14-1):
System install date:     2023-01-17
Last full system update: 2023-01-18
Is partially upgraded:   No
Relevant software:       snapper NetworkManager mkinitcpio nvidia-dkms
Windows dual boot:       Yes
Failed units:~~~

Why sudo? Check if you follow every time exactly the guide.

1 Like

cause the input cmd couldn't print the last line of output log where it says Windows dual boot. As it require sudo.

Windows dual boot: Probably (Run as root to verify)


sudo archlinux-java --help might help

but how does it help . I'm saying I already have Java Installed and correctly working everywhere.
Its just that the Gradle find correct path when launched from terminal (no sudo or anything extra).

but when i launched the Android Studio from the launcher icon then the Gradle show incorrect path .

below image might help as this is the same issue

Perhaps the KDE launcher starts before the path in your Fish config is sourced. This thread is rather old, but could be a clue: desktop environment - Registering a Standalong app in the Application Launcher of KDE - Unix & Linux Stack Exchange


Hey i did not understand what to do here . I followed the link but not sure what it says exactly.

Update: So after reading it. I tried and put my variable to /etc/environment/ and now everything works fine. Thanks but not sure if this was the best solution or not.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.