Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#10130 - JAVA_HOME env variable with JDK and JRE
Attached to Project:
Arch Linux
Opened by Denis A. Altoe Falqueto (denisfalqueto) - Wednesday, 09 April 2008, 01:53 GMT
Last edited by Eduardo Romero (kensai) - Friday, 04 July 2008, 16:21 GMT
Opened by Denis A. Altoe Falqueto (denisfalqueto) - Wednesday, 09 April 2008, 01:53 GMT
Last edited by Eduardo Romero (kensai) - Friday, 04 July 2008, 16:21 GMT
|
DetailsDescription:
Hi, As it is today, the $JAVA_HOME environment variable is pointed to the jre directory. This is fine when someone just installs the jre package. But if you install the jdk, this variable is very important for lots of java development tools, so it should point to the jdk directory. Nevertheless, as the jre.sh script in /etc/profile.d is executed after the jdk.sh (probably because of the ordering of the names), this variable is allways reset by jre.sh, even if we changed jdk.sh to configure that variable. So, it would be very good if the jre.sh script was smart enough to set $JAVA_HOME to the jdk directory in case the jdk package was installed. Maybe it could check the existence of $J2SDKDIR that is set up by jdk.sh. A possible solution could be: ---8<----- /etc/profile.d/jre.sh ---- 8<---- if [ -z $J2SDKDIR ] ; then export J2REDIR=/opt/java/jre export PATH=$PATH:$J2REDIR/bin export CLASSPATH=$CLASSPATH:$J2REDIR/lib else export J2REDIR=$J2SDKDIR fi export JAVA_HOME=$J2REDIR ---8<----- /etc/profile.d/jre.sh ---- 8<---- So it checks to see if $J2SDKDIR is set before setting the jre specific variables. Otherwise, it points $J2REDIR to $J2SDKDIR and points $JAVA_HOME allways to the right place. |
This task depends upon
Closed by Eduardo Romero (kensai)
Friday, 04 July 2008, 16:21 GMT
Reason for closing: Implemented
Additional comments about closing: Implemented on the latest 6u6 upgrade of the jre and jdk package.
Friday, 04 July 2008, 16:21 GMT
Reason for closing: Implemented
Additional comments about closing: Implemented on the latest 6u6 upgrade of the jre and jdk package.
Nevertheless, I looked over the jre's bin directory and found that it is a subset of the jdk's bin directory, with just one file absent: java_vm, which is in jre but not in jdk. It seems to be involved with starting the java plugin, but It is started even if not in the PATH, so I think it is not important in the jdk's bin dir.
The other files in jdk's bin are all symlinks to the jre, so there is not any problem in using the JDK when it is available. Moreover, there are some tools (Grails, for instance) which need some programs that are not in the JRE's dir. So I suggest you change it back. I can't see any worth point in keeping it this way.
I think if JDK's installed JAVA_HOME must to point into JDK folder.