# Why Is openSUSE Ignoring JAVA\_HOME Even After Correctly Setting It?

**URL:** <https://forums.suse.com/t/why-is-opensuse-ignoring-java-home-even-after-correctly-setting-it/45743>\
**Category:** General Discussion\
**Created:** [July 26, 2025, 1:20pm UTC](https://forums.suse.com/t/why-is-opensuse-ignoring-java-home-even-after-correctly-setting-it/45743 "2025-07-26T13:20:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tisabib](https://avatars.discourse-cdn.com/v4/letter/t/58f4c7/32.png) [@tisabib](https://forums.suse.com/u/tisabib)\
**Post date:** [July 26, 2025, 1:20pm UTC](https://forums.suse.com/t/why-is-opensuse-ignoring-java-home-even-after-correctly-setting-it/45743/1 "2025-07-26T13:20:43Z")

</div>

Hello

I am running into an issue on my openSUSE Leap system where the `JAVA_HOME` environment variable is being ignored; even though I have set it correctly in both `/etc/profile` and `.bashrc`. 🙃

When I echo `$JAVA_HOME`, it shows the correct path (e.g., `/usr/lib64/jvm/java-11-openjdk`), but some applications like Maven / Tomcat still report that Java is not set or default back to the system version. I have also tried setting it with `update-alternatives` but no luck.

I made sure the Java version is installed & matches the expected architecture. Interestingly; a fresh user account does pick up the `JAVA_HOME` setting without issue. Could this be something related to systemd, login shells / some environment caching behavior in SUSE? 😇

I am wondering if anyone else has had this issue & knows how to make the setting consistent across GUI apps, terminal sessions & services. 🙃 Checked [https://forums.opensuse.org/t/setting-up-environment-variables/128241](https://forums.opensuse.org/t/setting-up-environment-variables/128241) related to this.

While trying to troubleshoot this; I also ended up reading about [what is java](https://www.igmguru.com/blog/what-is-java) and its history with cross-platform compatibility, which makes it even more surprising how setting it up can still be this inconsistent across Linux distributions. 😇

Any suggestions or workarounds would be much appreciated.

Thank you !! 🙂

---

<div class="post-metadata">

**Author:** ![discourse\_ai\_spam](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@discourse\_ai\_spam](https://forums.suse.com/u/discourse_ai_spam)\
**Post date:** [July 26, 2025, 1:20pm UTC](https://forums.suse.com/t/why-is-opensuse-ignoring-java-home-even-after-correctly-setting-it/45743/2 "2025-07-26T13:20:44Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [July 30, 2025, 11:44am UTC](https://forums.suse.com/t/why-is-opensuse-ignoring-java-home-even-after-correctly-setting-it/45743/3 "2025-07-30T11:44:22Z")

</div>



---

<div class="post-metadata">

**Author:** ![bpedersen2](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/bpedersen2/32/9899_2.png) [@bpedersen2](https://forums.suse.com/u/bpedersen2)\
**Post date:** [August 5, 2025, 9:56am UTC](https://forums.suse.com/t/why-is-opensuse-ignoring-java-home-even-after-correctly-setting-it/45743/4 "2025-08-05T09:56:46Z")

</div>

Hi,

this is complex, but profile is only read for login session, so all systemd-managed services (like tomcat ) will not use that ( and there is the possibility to override this in the service config as well).

And a .bashrc is only read for the user it belongs to. And both are of course only re-read on login so for your shells to pick up the changes you need to login and out again.
