How to point JAVA_HOME to a JDK instead of JRE?

What’s the proper way to make JAVA_HOME point to a JDK instead of a JRE. I know about update-configurations but all those alternatives point to JREs. If I set it explicitly in .bashrc then it won’t get updated when patches are installed.

BTW: Who sets the default JAVA_HOME anyway?

well JAVA_HOME is just a system variable which can be defined in your .profile/.bash_profile file. As soon as you launch the application/executable and is running, it might be that the variable is redefined in it and then you have to open the executable/shell/application file and search for the variable and if you have rights change it to the value you want, in your case jdk instead of jre location(you have to know the location of the jre). Is this for a WebLogic instalation? in that case I can give you more details, so just ask.

Hi
Look down in /etc/profile.d there should be an alljava.sh file.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.23-0.1-default
up 1 day 0:01, 2 users, load average: 0.03, 0.05, 0.08
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Thanks. I see that alljava.sh will always set JAVA_HOME to the jdk if it exists. In my case, I think there was an explicit leftover setting in my .bashrc that was pointing it to the jre. Once I cleaned that up, I was picking up the jdk as expected.

The path to java on openSuse seems breathtakingly convoluted. It seems like the update-configuations mechanism should list jdk’s and jre’s and let you choose. In my case I think I had explicitly pointed it to the jre to address an obscure eclipse issue from a few releases ago.

See the update-alternatives program, in particular the --config option. E.g.

/usr/sbin/update-alternatives --config java

Hi
Glad you found out the issue, you may also look at modifying ~/.profile
instead of ~/.bashrc as well so when you login your variables will be
available.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.23-0.1-default
up 1 day 1:16, 2 users, load average: 0.04, 0.03, 0.00
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Hi,
More useful update-alternatives --config javac :wink:

Hi All,
My issue seems to be that the Netbeans installation I have knows where the JRE or JDK is but the Eclipse installation doesn’t.

I’ve tried a bunch of things…

  1. Set Class path
  2. Set Java home…

Eclipse doesn’t see Java anyway, When I go into Windows Preferences I don’t see Java or Installed JREs…

Whats am I missing…

Thanks
RV