Giter Club home page Giter Club logo

Comments (5)

lpedrosa avatar lpedrosa commented on May 25, 2024

I believe this is a groovy bug. The groovy team seemed to have fixed something when calling static methods, which are defined on interfaces:

However, something has changed on Java 9. I have created a simple example that reproduces the error shown above.

Other projects seems to be having the same problem:

Not sure what is the best approach here. Should this be raised as an issue in the Groovy project github?

from gradle.

sormuras avatar sormuras commented on May 25, 2024

According to the state of the linked Groovy issue 7879 it should be resolved since Groovy 2.4.11.

But, using

------------------------------------------------------------
Gradle 4.6
------------------------------------------------------------

Build time:   2018-02-28 13:36:36 UTC
Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          10-ea ("Oracle Corporation" 10-ea+42)
OS:           Windows 10 10.0 amd64

R:\dev\github\junit-team\junit5>gradlew build

with this Java 9 code:

java.util.spi.ToolProvider.findFirst('jar').get()

...it still fails with Method java.util.spi.ToolProvider.findFirst(Ljava/lang/String;)Ljava/util/Optional; must be InterfaceMethodref constant

from gradle.

sormuras avatar sormuras commented on May 25, 2024

Happens with Gradle 4.7 (Groovy 2.4.12) as well.
Seems to be fixed with Groovy 3.0-alpha-2, though:

groovy -e "java.util.spi.ToolProvider.findFirst('jar').get().run(System.out, System.err, '--version')"
WARNING: Using incubator modules: jdk.incubator.httpclient

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/../lib/groovy-3.0.0-alpha-2.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

jar 10

from gradle.

sormuras avatar sormuras commented on May 25, 2024

Seems to be fixed in 2.4.16: https://issues.apache.org/jira/browse/GROOVY-8528

from gradle.

oehme avatar oehme commented on May 25, 2024

This works fine with Groovy 2.4.15

from gradle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.