Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 677236 - dev-java/openjdk-11.0.2_p7 doesn't compile if _JAVA_OPTIONS is set
Summary: dev-java/openjdk-11.0.2_p7 doesn't compile if _JAVA_OPTIONS is set
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-04 01:38 UTC by Mike Lothian
Modified: 2019-02-23 20:35 UTC (History)
1 user (show)

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


Attachments
Build log (build.log,8.66 KB, text/plain)
2019-02-04 09:02 UTC, Mike Lothian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Lothian 2019-02-04 01:38:21 UTC
The configure does a check of the version but the wrong line is grepped if the warning line that _JAVA_OPTIONS is set is displayed

We should unset _JAVA_OPTIONS in the configure or fix the grep
Comment 1 Georgy Yakovlev archtester gentoo-dev 2019-02-04 02:37:27 UTC
can you please provide example output and show how it's exactly wrong?
Comment 2 Mike Lothian 2019-02-04 09:00:53 UTC
axion /home/fireburn # /opt/openjdk-bin-11.0.2_p7/bin/java -version
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
openjdk version "11.0.2" 2018-10-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.2+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.2+7, mixed mode)
Comment 3 Mike Lothian 2019-02-04 09:02:17 UTC
Created attachment 563710 [details]
Build log
Comment 4 Mike Lothian 2019-02-04 09:04:37 UTC
BOOT_JDK=/opt/openjdk-bin-11.0.2_p7/
HEAD=head
ECHO=echo
EGREP=egrep
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="10 11"

echo ${BOOT_JDK}

"$BOOT_JDK/bin/java" -version

BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`

echo ${BOOT_JDK_VERSION}

FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP "\"(${DEFAULT_ACCEPTABLE_BOOT_VERSIONS// /|})([\.+-].*)?\""`

echo ${FOUND_CORRECT_VERSION}
Comment 5 Georgy Yakovlev archtester gentoo-dev 2019-02-04 18:56:02 UTC
thanks, that was helpful. can see it now.
will commit a fix a bit later today, probably just unset the var as quickest fix.
Comment 6 Larry the Git Cow gentoo-dev 2019-02-05 05:15:41 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f6b5753f261cf3a48c19a57e1eb684a4b892cb5

commit 3f6b5753f261cf3a48c19a57e1eb684a4b892cb5
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2019-02-05 05:09:29 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2019-02-05 05:13:14 +0000

    dev-java/openjdk: unset _JAVA_OPTIONS
    
    If build vm is a unregistered one (built without gentoo-vm flag)
    java-pkg-2_pkg_setup() and hence java-pkg_init() is not called and
    _JAVA_OPTIONS is not handled.
    Just unset it.
    
    Closes: https://bugs.gentoo.org/677236
    
    Package-Manager: Portage-2.3.59, Repoman-2.3.12
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-java/openjdk/openjdk-11.0.2_p7.ebuild | 1 +
 dev-java/openjdk/openjdk-8.202_p08.ebuild | 1 +
 2 files changed, 2 insertions(+)
Comment 7 Mike Lothian 2019-02-23 18:43:16 UTC
This seems to have worked for openjdk:8 but I still had to unset _JAVA_OPTIONS manually on openjdk:11
Comment 8 Mike Lothian 2019-02-23 18:53:10 UTC
Ah, it probably should be unset along with "unset JAVA JAVAC XARGS" just before configure

Where it currently us  means it isn't unset if you're using a non "-bin" version for compiling
Comment 9 Georgy Yakovlev archtester gentoo-dev 2019-02-23 20:20:51 UTC
the logic is the following:
if you are using blessed gentoo openjdk (built with gentoo-vm useflag unmasked) to build new openjdk the eclass should handle unsetting

https://github.com/gentoo/gentoo/blob/master/eclass/java-utils-2.eclass#L2168-L2185 , unless you have I_WANT_GLOBAL_JAVA_OPTIONS set.


in case you don't use gentoo-vm useflag ebuild should unset it via the fix I committed.

anyway, makes sense to just unset it all the time, because there is no chance of building it with this variable without patching.
Comment 10 Larry the Git Cow gentoo-dev 2019-02-23 20:26:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95024cde4a946017684c37fbe99f1b1609ff6bf1

commit 95024cde4a946017684c37fbe99f1b1609ff6bf1
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2019-02-23 20:21:45 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2019-02-23 20:25:18 +0000

    dev-java/openjdk: unset _JAVA_OPTIONS before econf
    
    Closes: https://bugs.gentoo.org/677236
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-java/openjdk/openjdk-11.0.1_p13.ebuild | 2 +-
 dev-java/openjdk/openjdk-11.0.2_p7.ebuild  | 3 +--
 dev-java/openjdk/openjdk-8.202_p08.ebuild  | 3 +--
 3 files changed, 3 insertions(+), 5 deletions(-)
Comment 11 Mike Lothian 2019-02-23 20:35:54 UTC
Thanks