diffplug / goomph

IDE as build artifact
Apache License 2.0
130 stars 30 forks source link

java.lang.NoSuchFieldException: ucp #182

Closed mfriesen closed 2 years ago

mfriesen commented 2 years ago

Using the following build.gradle plugins { id "com.diffplug.oomph.ide" version "3.35.0" }

apply plugin: 'com.diffplug.oomph.ide' oomphIde { repoEclipseLatest() jdt {} splash rootProject.file('_images/spotless_logo.png') style { classicTheme() // oldschool cool niceText() // nice fonts and visible whitespace }

    addAllProjects()

    thirdParty {
            minimalistGradleEditor {}
            //tmTerminal {}
    }

}

After running: gradle ide

Get Error:

Task :ideSetupP2 FAILED WARNING: Using incubator modules: jdk.incubator.vector, jdk.incubator.foreign

FAILURE: Build failed with an exception.

Caused by: java.lang.NoSuchFieldException: ucp at com.diffplug.gradle.JRE.getClasspath(JRE.java:57) at com.diffplug.gradle.eclipserunner.JarFolderRunner.open(JarFolderRunner.java:62) at com.diffplug.gradle.eclipserunner.JarFolderRunner.run(JarFolderRunner.java:47) at com.diffplug.gradle.eclipserunner.JarFolderRunnerExternalJvm$RunOutside.run(JarFolderRunnerExternalJvm.java:126) at com.diffplug.gradle.JavaExecable.main(JavaExecable.java:171)

Gradle: 7.4.1 openjdk: 11.0.2

nedtwigg commented 2 years ago

Sorry, but the oomph.ide part of this project is mostly abandoned. I'm happy to merge PRs for it, and I won't intentionally break it, but the only active part of this project now is the eclipse.mavencentral plugin.

restlessronin commented 2 years ago

I'm getting the same exception when I try to use 'equinoxLaunch'

gradle 7.4.2.

./gradlew -v
...
JVM:          17.0.1 (Azul Systems, Inc. 17.0.1+12-LTS)
...

It seems to be this line of code.

https://github.com/diffplug/goomph/blob/f49fa797b535986812924e4b24d3ec417a281b5c/src/main/java/com/diffplug/gradle/JRE.java#L57

based on the first few google search results, it seems to be a classloader change from Java 16 onwards. Changing JAVA_HOME to azul 11 solves the problem.

The discussion here seems to go over possible approaches to solving the problem.

https://github.com/bazelbuild/bazel/pull/15081

nedtwigg commented 2 years ago

Happy to take a PR for fixing Java 16+.

restlessronin commented 2 years ago

If I just use the same fix as used in the PR I linked above, it's only a few lines of code.

Unfortunately, I'm completely unfamiliar with the workflow for building and testing a gradle plugin, and I'm a little wary of starting down that particular rabbit hole at the moment.

Let me make the changes (that shouldn't take much time) and open a PR. You can decide if it's worth testing and merging.

restlessronin commented 2 years ago

I found this: https://github.com/diffplug/goomph/blob/f49fa797b535986812924e4b24d3ec417a281b5c/CONTRIBUTING.md.

Hopefully, it's as easy to do as it seems :-)

nedtwigg commented 2 years ago

Attempted fix in 3.37.1.

restlessronin commented 2 years ago

equinoxLaunch is no longer stopping there (still not working fully :-), so at least that's fixed.