Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 99360 - java update changes default vm
Summary: java update changes default vm
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: InVCS
: 113213 (view as bug list)
Depends on: 127816
Blocks:
  Show dependency tree
 
Reported: 2005-07-17 15:08 UTC by Volker Hemmann
Modified: 2006-06-30 19:47 UTC (History)
2 users (show)

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 Volker Hemmann 2005-07-17 15:08:55 UTC
Hi, 
 
everytime a java uipdate is comming in, the default system vm is changed. 
 
For example: 
I have 1.5 as user&system-vm 
I do an update world 
java 1.4.2.x.x is installed 
1.4.2.x.x is suddenly system&user vm 
 
I am wondering, why some apps behave 'strange'. 

Reproducible: Always
Steps to Reproduce:
1.emerge sun-jdk1.5 
2.set 1.5 as default 
3.emerge 1.4.2.X 
 


Expected Results:  
I do not want ANY changes in the system-vm EVER without my explicit permission.
Comment 1 Thomas Matthijs (RETIRED) gentoo-dev 2005-07-17 15:14:03 UTC
This cannot be done with the current system as it would break deps
say you have 1.3 system-vm, and a package you are merging deps on 1.4, it will 
only work if the 1.4 becomes system-vm
Comment 2 Volker Hemmann 2005-07-17 15:25:29 UTC
Hi, 
 
well, it breaks apps for me now. 
 
When I am using 1.5, am really fed up, when I have suddenly 1.4.2 
 
When 1.4.2 would be emerged for a certain package, sure, but at the moment, I have 
to ckeck EVERYTIME, if the correct java-vm is set. 
Comment 3 Thomas Matthijs (RETIRED) gentoo-dev 2005-07-17 15:38:27 UTC
well 1.5 is package.masked and known to break alot

i/we are working on a new system that will let it change vm at merge time, this 
would also remove the need to force the system-vm when merging a jdk
Comment 4 Volker Hemmann 2005-07-17 16:57:06 UTC
Hi, 
 
ok, the system-vm has to be changed, but why has the user vm be changend too? 
Comment 5 Thomas Matthijs (RETIRED) gentoo-dev 2005-07-17 16:59:59 UTC
user vm is not touched.
Comment 6 Volker Hemmann 2005-07-17 17:27:28 UTC
ok, now I'm puzzled. 
 
I have set 1.5 as user&system vm ages ago. 
 
But I have to set 1.5 as user&system vm (once as user, once as root) everytime I 
update java? 
 
Because that is what is happening to me. 
I set 1.5, do stuff, some days later it is 1.4 again. 
 
 
Comment 7 Thomas Matthijs (RETIRED) gentoo-dev 2005-07-17 17:33:57 UTC
are you sourcing the files in ~/.gentoo/ to set user vm?
Comment 8 Volker Hemmann 2005-09-03 22:19:42 UTC
Hi, 
 
I use java-config -s to set the user-vm + source the files in ~/.gentoo, and relog. 
 
And it is fine. 
 
But after a java 1.4.2-X update, user&system vm are set to 1.4.2-X 
Comment 9 Thomas Matthijs (RETIRED) gentoo-dev 2005-11-22 02:44:52 UTC
*** Bug 113213 has been marked as a duplicate of this bug. ***
Comment 10 Volker Hemmann 2006-01-27 14:27:01 UTC
Hi,

yesterday something updated blackdown java.

Before that system&user vm were sun-jdk-1.5.0.06

After that system&user vm were: blackdown-jdk-1.4.2.03

Please stop changing the user vm!

(oh, and after setting sun-java as user-vm I did source .gentoo/java-env & source .gentoo/java and after a relog blackdown was again the user vm...)
Comment 11 Assaf Berg 2006-02-02 08:18:44 UTC
(In reply to comment #1)
> This cannot be done with the current system as it would break deps
> say you have 1.3 system-vm, and a package you are merging deps on 1.4, it will 
> only work if the 1.4 becomes system-vm
> 

This does not make sense to me. Java will be updated without any deps as well (in case the jdk itself has an update). So in case you have both 1.4 and 1.5 installed the system vm will switch back and forth between them (in case they get updated in an alternating matter).

It would be better to have a use flag 'default' similar to the kernel source 'symlink' use flag...
Comment 12 Josh Nichols (RETIRED) gentoo-dev 2006-02-02 08:51:35 UTC
(In reply to comment #10)
> (oh, and after setting sun-java as user-vm I did source .gentoo/java-env &
> source .gentoo/java and after a relog blackdown was again the user vm...)

You would need to add 'source ~/.gentoo/java-env' to your ~/.bash_profile or ~/.bashrc so that it gets sourced every time you log in, so that the right variables get set.


(In reply to comment #11)
> This does not make sense to me. Java will be updated without any deps as well
> (in case the jdk itself has an update). So in case you have both 1.4 and 1.5
> installed the system vm will switch back and forth between them (in case they
> get updated in an alternating matter).
> 
> It would be better to have a use flag 'default' similar to the kernel source
> 'symlink' use flag...

We do have a working solution for this bug, hence the InSVN keyword. It involves many changes to java-config, and how java packages are built. We are currently preparing to migrate to this new way of doings.

This bug comes from the fact that JDKs install to /opt/PN-PV. So your JAVA_HOME for the system might be set to  So you go and update to 1.4.2.03. /opt/blackdown-jdk-1.4.2.02 goes away, and now there is /opt/blackdown-jdk-1.4.2.03, but your VM is still pointing at /opt/blackdown-jdk-1.4.2.02. The workaround for this was to set the freshly upgraded jdk to the system-vm. Less than ideal if you ask me, but that's how it currently is.

With the new system, we still have stuff in /opt/PN-PV, but now there are symlinks in /usr/lib/jvm. For example /usr/lib/jvm/blackdown-jdk-1.4 would point to /opt/blackdown-jdk-1.4.2.02. So now your JAVA_HOME would be /usr/lib/jvm/blackdown-jdk-1.4. Now when you upgrade, the symlink gets updated, so you automatically are pointing at the right install.

As for the issue you brought up about having 1.4 and 1.5 and being switched back and forth while building...
There is a difference between a system vm and a build vm. The build vm is entirely separate from the system vm, and is controlled by a config file in /etc, or lacking that, some sane defaults for the particular platform.

At build time, the DEPEND/RDEPEND is checked to see what the jdk/jre dependencies are. Like if its >=virtual/jdk-1.4, it'll see that it wants 1.4. It'll check the config and/or the defaults, and switch to an appropriate VM for building things.

The primary motivation of this was that some packages don't compile with 1.5. In cases like this, the dependency would look like =virtual/jdk-1.4*, so the build vm will only use a 1.4 jdk.

Hope this gives you an idea what is coming up.
Comment 13 Assaf Berg 2006-02-02 10:37:04 UTC
Sounds great! Thanks
Comment 14 Josh Nichols (RETIRED) gentoo-dev 2006-06-30 19:47:41 UTC
Fixed in the new Java system. Marking fixed.