Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 9899 - java-config does not set user vm correctly
Summary: java-config does not set user vm correctly
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 19032
  Show dependency tree
 
Reported: 2002-10-29 08:31 UTC by Mike Hostetler
Modified: 2004-05-28 06:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Hostetler 2002-10-29 08:31:37 UTC
The java-config utility does not set the user-specified java vm correctly.

Example:
In one terminal, I did this:
mikeh@tardis mikeh $ java-config --set-user-vm=sun-jdk-1.3.1.06
Now using Sun JDK 1.3.1.06 (/etc/env.d/java/20sun-jdk-1.3.1.06)

I opened another session, logged in as 'mikeh', and did this:
mikeh@tardis mikeh $ echo $JAVA_HOME
/opt/sun-jdk-1.3.1.06
mikeh@tardis mikeh $ which java
/opt/blackdown-jdk-1.3.1/bin/java

So $JAVA_HOME is set correctly, but 'java' will run from /opt/blackdown-jdk 
(the system-wide default).

The problem is this line in ~/.gentoo/java-env:
PATH=${PATH}:/opt/sun-jdk-1.3.1.06/bin:/opt/sun-jdk-1.3.1.06/jre/bin

It should put the new java path in the front, since /opt/blackdown-jdk is set as
the path in /etc/profile.env (since it's the system-wide path)
Comment 1 dhek bhun kho 2002-12-02 04:56:27 UTC
Have you run:
$ env-update
$ source /etc/profile

Otherwise the scirpts in /etc/env.d won't point to the new jvm you want to use
Comment 2 Adrian Almenar 2002-12-09 16:17:22 UTC
You should run env-update after java-config --set-user-vm=xx and login again.
Comment 3 Robert Schuster 2004-05-27 14:42:44 UTC
I have the same problem as mikeh. Although this bug should be resolved for years it seems that it isnt.
I have 3 jdks installed and have chosen sun-jdk-1.4.2.04 as the system VM.
when i logon as regular user, change to to blackdown-jdk-1.4.1 or sun-jdk-1.5.0, su to root and run env-update and then relog as user the jdk is not changed.
The file ~/.gentoo/java was updated and shows the correct entries but it is somehow not integrated into the shell (bash btw)
Comment 4 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2004-05-28 03:54:00 UTC
You must manually add ~/.gentoo/java to the end of your .bashrc:

[ -f $HOME/gentoo/java ] && source $HOME/.gentoo/java
Comment 5 Mike Hostetler 2004-05-28 06:27:33 UTC
This bug is still open?

A clearer fix would be to make the Java executable JAVA_HOME/bin/java. IOW:
  JAVA_HOME=/path/to/jdk
  PATH=$PATH:$JAVA_HOME/bin