Opened 18 months ago

Last modified 18 months ago

#58501 assigned defect

Gradle-5.4.1 does not even start

Reported by: mouse07410 (Mouse) Owned by: amake (Aaron Madlon-Kay)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: gradle


MacOS Mojave 10.14.4, Oracle JDK-1.8.0_211, Xcode-10.2.1, current Macports and current stable Gradle port 5.4.1 (current groovy port installed).

Problem: installation appears fine, but even the simplest invocation fails. I suspect pilot's error rather than software bug, but help would be greatly appreciated:

$ sudo port install gradle
--->  Fetching archive for gradle
--->  Attempting to fetch gradle-5.4.1_0.darwin_18.noarch.tbz2 from
--->  Attempting to fetch gradle-5.4.1_0.darwin_18.noarch.tbz2.rmd160 from
--->  Installing gradle @5.4.1_0
--->  Activating gradle @5.4.1_0
--->  Cleaning gradle
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.
$ gradle --version
[main] INFO - Initialized native services in: /Users/ur20980/.gradle/native

FAILURE: Build failed with an exception.

* What went wrong:
org.slf4j.impl.SimpleLogger cannot be cast to org.gradle.api.logging.Logger

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at
$ java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
$ echo $JAVA_HOME
$ ll /Library/Java/Extensions/slf4j*.jar
-rw-r--r--  1 root  wheel  41203 May 20 10:58 /Library/Java/Extensions/slf4j-api-1.7.25.jar
-rw-r--r--  1 root  wheel  15257 May 20 15:53 /Library/Java/Extensions/slf4j-simple-1.7.25.jar

Invoking with extra flags --stacktrace or --debug did not add anything to the above output.

Again, your help figuring out what seems wrong with the configuration and how to straighten it up would be appreciated!

Change History (4)

comment:1 Changed 18 months ago by amake (Aaron Madlon-Kay)

Resolution: duplicate
Status: newclosed

Duplicate of #56768. Don't invoke from ~.

comment:2 Changed 18 months ago by mouse07410 (Mouse)

No, it is not a duplicate. And it fails this way when invoked from *any* directory, including the project where I tried to use it.

Don't invoke from ~

Sorry, irrelevant and does not help.

What did help/fix this problem was

  • making sure there is no SLF4J jars on the classpath, and
  • making sure there is LOG4J on the classpath, including

Here's the result of invoking gradle in ~ (for those who don't think it should work):

$ pwd
$ gradle --version

Gradle 5.4.1

Build time:   2019-04-26 08:14:42 UTC
Revision:     261d171646b36a6a28d5a19a69676cd098a4c19d

Kotlin:       1.3.21
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          1.8.0_211 (Oracle Corporation 25.211-b12)
OS:           Mac OS X 10.14.4 x86_64


Coincidentally, it now works with the project as well.

This probably should be documented somewhere, because (at least to me) the need to make LOG4J available on the classpath and to remove SLF4J from the classpath was non-obvious.

P.S. Re-opening to request the "duplicate" comment removed, and to ensure this explanation is actually read. Because that shooting-from-the-hip closing of the ticket is not right.

Last edited 18 months ago by mouse07410 (Mouse) (previous) (diff)

comment:3 Changed 18 months ago by mouse07410 (Mouse)

Resolution: duplicate
Status: closedreopened

comment:4 Changed 18 months ago by jmroot (Joshua Root)

Cc: amake@… removed
Owner: set to amake
Status: reopenedassigned
Note: See TracTickets for help on using tickets.