Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 615884 - sci-mathematics/geogebra-5.0.339.0_p20170308 - error: no suitable method found for hashCode(double)
Summary: sci-mathematics/geogebra-5.0.339.0_p20170308 - error: no suitable method foun...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Amy Liffey
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-17 19:06 UTC by Martin von Gagern
Modified: 2017-11-21 10:21 UTC (History)
0 users

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


Attachments
build log (sci-mathematics:geogebra-5.0.339.0_p20170308:20170417-185230.log,22.35 KB, text/plain)
2017-04-17 19:06 UTC, Martin von Gagern
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2017-04-17 19:06:03 UTC
Created attachment 470284 [details]
build log

Building geogebra fails for me:

/var/tmp/portage/sci-mathematics/geogebra-5.0.339.0_p20170308/work/geogebra-7d5ac993d3f88f6701f56edbfe325d86afcaad87/common/src/main/java/org/geogebra/common/geogebra3D/kernel3D/geos/GeoConicSection.java:102: error: no suitable method found for hashCode(double)
                        return index + 43 * Double.hashCode(value);
                                                  ^
    method Double.hashCode() is not applicable
      (actual and formal argument lists differ in length)
    method Object.hashCode() is not applicable
      (actual and formal argument lists differ in length)

The static Double.hashCode(double) was added with Java 8:
http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html#hashCode-double-

I have oracle-jdk-bin-1.8 installed on my system, but apparently that's not being used.
# java-config -L
The following VMs are available for generation-2:
*)      IcedTea JDK 7.2.6.9 [icedtea-7]
2)      IcedTea JDK 3.3.0 [icedtea-8]
3)      Oracle JDK 1.8.0.121 [oracle-jdk-bin-1.8]

I shouldn't have to set my system VM to make that build succeed, but neither setting JAVA_PKG_FORCE_VM=oracle-jdk-bin-1.8 nor GENTOO_VM=oracle-jdk-bin-1.8 did make the build succeed. Not sure how to express this for gradle.
Comment 1 Martin von Gagern 2017-04-18 21:15:57 UTC
Exporting JAVA_HOME (and GENTOO_VM just to be safe) worked for me:

GENTOO_VM=oracle-jdk-bin-1.8 \
JAVA_HOME=/usr/lib/jvm/oracle-jdk-bin-1.8 \
emerge geogebra

So perhaps the ebuild should be doing something along those lines.
Perhaps the correct approach is

export GENTOO_VM=$(java-config --select-vm=oracle-jdk-bin -f)
export JAVA_HOME=$(java-config --select-vm=oracle-jdk-bin -O)

or something like this. Calling java-pkg_switch-vm from java-utils-2.eclass should be a lot cleaner, more powerful and more consistent, though.
Comment 2 Amy Liffey gentoo-dev 2017-08-05 11:07:15 UTC
(In reply to Martin von Gagern from comment #1)
> Exporting JAVA_HOME (and GENTOO_VM just to be safe) worked for me:
> 
> GENTOO_VM=oracle-jdk-bin-1.8 \
> JAVA_HOME=/usr/lib/jvm/oracle-jdk-bin-1.8 \
> emerge geogebra
> 
> So perhaps the ebuild should be doing something along those lines.
> Perhaps the correct approach is
> 
> export GENTOO_VM=$(java-config --select-vm=oracle-jdk-bin -f)
> export JAVA_HOME=$(java-config --select-vm=oracle-jdk-bin -O)
> 
> or something like this. Calling java-pkg_switch-vm from java-utils-2.eclass
> should be a lot cleaner, more powerful and more consistent, though.

Geogebra has as build time dependency oracle-jdk-bin. Isn't it enough?

I get that people use more versions of java but you can always use eselect?
Comment 3 Larry the Git Cow gentoo-dev 2017-11-21 10:21:08 UTC
The bug has been closed via the following commit(s):

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

commit e9742e25a4746e6e4b2cf97cc5428689bcfc0d9d
Author:     Amy Liffey <amynka@gentoo.org>
AuthorDate: 2017-11-21 10:17:53 +0000
Commit:     Amy Liffey <amynka@gentoo.org>
CommitDate: 2017-11-21 10:20:27 +0000

    sci-mathematics/geogebra: enable oracle-jdk-bin during buildtime
    
    Closes:https://bugs.gentoo.org/615884
    
    Package-Manager: Portage-2.3.8, Repoman-2.3.3

 ...9.0_p20170308.ebuild => geogebra-5.0.339.0_p20170308-r1.ebuild} | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)