How do I get Gradle to run the java compiler?

Viewed 21

I'm running Gradle 7.4.2, and 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

Here is the build.gradle file:

apply plugin: 'idea'

group 'com.prosc'
version '1.0-SNAPSHOT'

compileJava.options.encoding = 'UTF-8'

ext.buildLocation = System.getenv("buildLocation") ?: rootDir

repositories {
    mavenCentral()
}

idea {
    module {
        inheritOutputDirs = true
    }
}


sourceSets {
    main {
        java {
            srcDirs = ["src"]
        }
        resources {
            srcDirs = ["src"]
        }
    }
    test {
        java {
            srcDirs = ["test_src"]
        }
        resources {
            srcDirs = ["test_src"]
        }
    }
}

ext.com_squareup_retrofit2_converter_gson_2_9_0 = 'com.squareup.retrofit2:converter-gson:2.9.0'
ext.com_squareup_retrofit2_converter_gson_2_9_0_files = files ( "${buildLocation}/out/gradle/repoLibs/converter-gson-2.9.0.jar",
    "${buildLocation}/out/gradle/repoLibs/retrofit-2.9.0.jar",
    "${buildLocation}/out/gradle/repoLibs/okhttp-3.14.9.jar",
    "${buildLocation}/out/gradle/repoLibs/okio-1.17.2.jar",
    "${buildLocation}/out/gradle/repoLibs/gson-2.8.5.jar")
ext.IntellijAnnotations = 'org.jetbrains:annotations:16.0.1'
ext.IntellijAnnotations_files = files ( "${buildLocation}/out/gradle/repoLibs/annotations-16.0.1.jar")
ext.junit = 'junit:junit:4.13.2'
ext.junit_files = files ( "${buildLocation}/out/gradle/repoLibs/junit-4.13.2.jar",
    "${buildLocation}/out/gradle/repoLibs/hamcrest-core-1.3.jar")


dependencies {
    implementation project(':ProscCore')
    testImplementation project(':ProscCore').sourceSets.test.output
    implementation project(':ProscDeployment')
    testImplementation project(':ProscDeployment').sourceSets.test.output
    api com_squareup_retrofit2_converter_gson_2_9_0
    implementation project(':LicenseClientAPI')
    testImplementation project(':LicenseClientAPI').sourceSets.test.output
    implementation IntellijAnnotations
    implementation project(':ProscCoreDesktop')
    testImplementation project(':ProscCoreDesktop').sourceSets.test.output
    testCompileOnly junit
}
1 Answers

The problem occurs because Java runtime is broken for aws/codebuild/amazonlinux2-x86_64-standard:4.0

Related