Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoSuchFieldException: ucp #182

Closed
mfriesen opened this issue Mar 24, 2022 · 7 comments
Closed

java.lang.NoSuchFieldException: ucp #182

mfriesen opened this issue Mar 24, 2022 · 7 comments
Labels

Comments

@mfriesen
Copy link

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.

  • What went wrong:
    Execution failed for task ':ideSetupP2'.

java.lang.NoSuchFieldException: ucp

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
Copy link
Member

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.

@nedtwigg nedtwigg added the bug label Jun 16, 2022
@restlessronin
Copy link
Contributor

restlessronin commented Jun 25, 2022

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.

Field ucpFld = clz.getDeclaredField("ucp");

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.

bazelbuild/bazel#15081

@nedtwigg
Copy link
Member

Happy to take a PR for fixing Java 16+.

@restlessronin
Copy link
Contributor

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
Copy link
Contributor

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

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

@nedtwigg
Copy link
Member

Attempted fix in 3.37.1.

@restlessronin
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants