Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buildship » build using gradle fails(probably Eclipse <-> gradle <-> Java version mismatch)
build using gradle fails [message #1871352] Mon, 23 September 2024 08:47 Go to next message
Horst Weigelt is currently offline Horst WeigeltFriend
Messages: 2
Registered: September 2024
Junior Member
I use Eclipse Version: 2022-12 (4.26.0)
and develop a Java EE application using JDK 11
The project is a 'gradle'-project using gradle-wrapper

gradle-wrapper.properties contains the line
distributionUrl=Link to gradle 5.1

(I am not allowed to post links :-()

When building/refreshing the project I receive the 'Gradle Error Marker' with the description


Could not run build action using connection to Gradle distribution 'Link to gradle 5.1'.
Could not open cp_init remapped class cache for 20c8l7ig396u5x5c2ubn9f016 (C:\Users\<user>\.gradle\caches\5.1\scripts-remapped\eclipsePlugin_6whkpzgottjkmx70hnwxb2myq\20c8l7ig396u5x5c2ubn9f016\cp_init2057f5947a0c733ed37f74330b3447af).
Could not open cp_init generic class cache for initialization script 'C:\Users\<user>\eclipse-workspace22\.metadata\.plugins\org.eclipse.buildship.core\init.d\eclipsePlugin.gradle' (C:\Users\<user>\.gradle\caches\5.1\scripts\20c8l7ig396u5x5c2ubn9f016\cp_init\cp_init2057f5947a0c733ed37f74330b3447af).
Could not initialize class org.codehaus.groovy.classgen.Verifier

The directories/files mentioned in the message are in the file system.

then I tried

distributionUrl=Link to gradle 7.4.2

in gradle-wrapper.properties

which results in the error message:

The supplied phased action failed with an exception.
A problem occurred configuring root project '<projectname>'.
A problem occurred evaluating root project '<projectname>'.
Could not find method compile() for arguments [org.jboss.weld.servlet:weld-servlet-shaded:3.1.5.SP1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Eclipse Gradle Plugin used according to Installation Details:
Gradle Inc. Gradle Tooling API 7.4.2.v20220510-1312-s org.gradle.toolingapi


Building the application with a standalone gradle distribution works fine.
So I assume a mismatch between Java <-> Eclipse <-> gradle

What is the correct configuration?
How can I obtain more information?


Any help is appreciated
Re: build using gradle fails [message #1871457 is a reply to message #1871352] Wed, 25 September 2024 08:59 Go to previous message
Horst Weigelt is currently offline Horst WeigeltFriend
Messages: 2
Registered: September 2024
Junior Member
After removing
-vm
C:/Users/<user>/.p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.5.v20221102-0933/jre/bin
in eclipse.ini
the error does not occur anymore.
In the project and workspace setup (GUI) everything was set to Java11 - there was nothing related to a Java17 JRE :-(
Previous Topic:Eclipse won't resolve dependencies
Goto Forum:
  


Current Time: Fri Sep 27 04:06:02 GMT 2024

Powered by FUDForum. Page generated in 0.03106 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top