Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101272 - get_jvm_env_var of java-config should not get values from env[]
Summary: get_jvm_env_var of java-config should not get values from env[]
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2005-08-03 18:01 UTC by Sok Ann Yap
Modified: 2006-07-01 09:53 UTC (History)
0 users

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


Attachments
proposed patch for jc_util.py (jc_util.diff,705 bytes, patch)
2005-08-03 18:03 UTC, Sok Ann Yap
Details | Diff
proposed patch for java.eclass (java-eclass.diff,1.75 KB, patch)
2005-08-03 18:16 UTC, Sok Ann Yap
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sok Ann Yap 2005-08-03 18:01:27 UTC
Currently, get_jvm_env_var will try env[] first before trying to  
get_line_from_env_file. This could introduce some inconsistent behaviors. For 
example, if a new system VM is set by emerging a jdk/jre ebuild, running java-
config -f (without sourcing /etc/profile first) would still show the old VM or 
show nothing if the old VM has been unmerged in the process. This is despite 
what the man pages say:

-f --show-active-vm
    Show the JVM that's currently active, as set via --set-system-vm or --set-
user-vm.

In my opinion, regardless of whether "env-update && source /etc/profile" has 
been run, java-config -L/-f should reflect what has been set by -S/-s. It should 
show the settings that have been set by itself and not worry about the current 
environment variables.

Reproducible: Always
Steps to Reproduce:
1. java-config -L
[sun-jdk-1.5.0.04] "Sun JDK 1.5.0.04" (/etc/env.d/java/20sun-jdk-1.5.0.04) *
[blackdown-jdk-1.4.2.02] "Blackdown JDK 1.4.2.02" (/etc/env.d/java/20blackdown-
jdk-1.4.2.02)
2. java-config -S blackdown-jdk-1.4.2.02
3. java-config -f; java -version

Actual Results:  
sun-jdk-1.5.0.04
java version "1.5.0_04"

Expected Results:  
blackdown-jdk-1.4.2.02
java version "1.5.0_04"
Comment 1 Sok Ann Yap 2005-08-03 18:03:43 UTC
Created attachment 65034 [details, diff]
proposed patch for jc_util.py
Comment 2 Sok Ann Yap 2005-08-03 18:12:38 UTC
Additionally, with a consistent and self-containing java-config, it would 
probably be much easier to change the policies specified in bug 9289, comment 7 
from

1) If you merge a JRE and a JDK is already present, we'll keep the 
   JDK as the default system VM.
2) If you merge a JDK, it will be set as the default system VM regardless
3) If you unmerge either a JDK or a JRE, a big fat warning will tell you
   to run java-config manually to select your preferred VM.

to

1) If you merge either a JDK or a JRE, it will be set as the default system VM
   if none has been set
2) If you unmerge either a JDK or a JRE, a big fat warning will tell you
   to run java-config manually to select your preferred VM.

The "regardless" part of current policy #2 is a bit annoying because there are 4 
JVMs on my system (sun-jdk 1.4, 1.5, 1.6pre and blackdown-jdk 1.4)
Comment 3 Sok Ann Yap 2005-08-03 18:16:14 UTC
Created attachment 65035 [details, diff]
proposed patch for java.eclass
Comment 4 Josh Nichols (RETIRED) gentoo-dev 2006-07-01 09:53:40 UTC
These issues have been addressed with the new Java system.