[Live-demo] Where should JAVA_HOME be set (if overriding default=openjdk 1.7)?

edgar.soldin at web.de edgar.soldin at web.de
Fri Jan 13 16:48:26 EST 2012


On 13.01.2012 21:51, Hamish wrote:
> Cameron wrote:
>> I wonder whether it would be possible to set up a
>> little gui widget which switches the JAVA_HOME
>> between openjdk and sun-java. This could be used
>> by testers to turn on openjdk and find out if
>> applications work or not.
> 
> Not generally possible to do it system wide on the
> ISO; possible on the VM but it requires a reboot.
> /etc/profile.d/set_JAVA_HOME.sh would need to be
> edited with `sed -i` (or simply replaced).
> 

that's kind of tricky.. but if i'd have to do it i'd setup a virtual JAVA_HOME in .profile say '/usr/lib/jvm/java-selected/' which is a symlink to the default JAVA_HOME. with a suid'd script this one could be changed to the other jre path via desktop link command like 'exo-open --launch TerminalEmulator switch_jre.sh'. this would open a terminal which would run the script and could tell which jre is now in use.
the default java binary links would have to point to /usr/lib/jvm/java-selected/bin/* as well.

this could lead to issues when one java app is running and the version gets switched but for finding out if one application runs with 6 or 7 this should suffice.

generally i'd suggest to setup java binary symlinks for the live-dvd. e.g. /usr/local/bin/java(6|7) .. this way the java apps can specifically choose their version on the live-dvd. of course they could as well define a JAVA_HOME in their scripts.

..something like dat, ede


More information about the Live-demo mailing list