summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/java-utils-2.eclass22
1 files changed, 21 insertions, 1 deletions
diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index d6c856b95f7e..96d1cd67ae32 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -6,7 +6,7 @@
#
# Licensed under the GNU General Public License, v2
#
-# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.63 2007/03/03 20:37:35 betelgeuse Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.64 2007/03/05 22:56:25 betelgeuse Exp $
# -----------------------------------------------------------------------------
@@ -1799,6 +1799,26 @@ use_doc() {
java-pkg_init() {
unset JAVAC
unset JAVA_HOME
+
+ # People do all kinds of weird things.
+ # http://forums.gentoo.org/viewtopic-p-3943166.html
+ local silense="${SILENCE_JAVA_OPTIONS_WARNING}"
+ local accept="${I_WANT_GLOBAL_JAVA_OPTIONS}"
+ if [[ -n ${_JAVA_OPTIONS} && -z ${accept} && -z ${silense} ]]; then
+ ewarn "_JAVA_OPTIONS changes what java -version outputs at least for"
+ ewarn "sun-jdk vms and and as such break configure scripts that"
+ ewarn "use it (for example app-office/openoffice) so we filter it out."
+ ewarn "Use SILENCE_JAVA_OPTIONS_WARNING=true in the environment (use"
+ ewarn "make.conf for example) to silence this warning or"
+ ewarn "I_WANT_GLOBAL_JAVA_OPTIONS to not filter it."
+ fi
+
+ if [[ -z ${accept} ]]; then
+ unset _JAVA_OPTIONS
+ # phase hooks make this run many times without this
+ I_WANT_GLOBAL_JAVA_OPTIONS="true"
+ fi
+
java-pkg_init_paths_
java-pkg_switch-vm
PATH=${JAVA_HOME}/bin:${PATH}