Gradle can't run Java compiler

I get an error that there was a problem starting the compiler. I cannot find any details or reason. Why isn’t the error message from launching the compiler output to the log? The message recommends using --scan, but I’m doing that.

2022-09-22T16:40:40.905+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
876 2022-09-22T16:40:40.905+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ‘:LicenseClientAPI:compileJava’.
877 2022-09-22T16:40:40.906+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > A problem occurred starting process ‘command ‘/usr/lib/jvm/java-17-amazon-corretto.x86_64/bin/javac’’
878 2022-09-22T16:40:40.906+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
879 2022-09-22T16:40:40.906+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
880 2022-09-22T16:40:40.906+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --stacktrace option to get the stack trace.
881 2022-09-22T16:40:40.906+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --scan to get full insights.
882 2022-09-22T16:40:40.906+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
883 2022-09-22T16:40:40.906+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org

This is with Gradle 7.4.2

Update - I discovered that the AWS CodeBuild image is broken and that it doesn’t include Java (despite claiming to), so this is a configuration problem.

However, the lack of error reporting is a big issue - if a command fails, Gradle should always include the error message of the underlying failure.

If you run with --stacktrace, you probably get the information you are after.
By default you see the error message, which is A problem occurred starting process ‘command ‘/usr/lib/jvm/java-17-amazon-corretto.x86_64/bin/javac’’ and if you want more details, you have to request them.