1

I'm currently using LibericaJDK-11 as my default JRE in eclipse, also in my project. I added Gradle to my Project and everytime I Refresh the Project via Gradle. It sets the JRE to JavaSE-11. And i have to manually put it back to Liberica.

Is there a way to set a default JRE for Gradle in gradle.build oder gradle.settings?

The following code is my gradle.build.

plugins {
    id 'java-library'
    id 'application'
    id 'pmd'
}


version = '0.0.1'
group = 'zuulsLostPlace.MainApp'

application{
    mainClassName = "zuulsLostPlace.MainApp"
}


dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
}

test {
    useJUnitPlatform()
}

repositories {
    mavenCentral()
}

task(runGameNoGUI, dependsOn: 'classes', type: JavaExec) {
    group 'application'
    description 'Starts the Text Adventure without GUI'
    main = 'zuulsLostPlace.model.Game'
    standardInput = System.in
    ignoreExitValue true
    classpath = sourceSets.main.runtimeClasspath
}

task(runGameGUI, dependsOn: 'classes', type: JavaExec) {
    group 'application'
    description 'Starts the Text Adventure with GUI'
    main = 'zuulsLostPlace.MainApp'
    standardInput = System.in
    ignoreExitValue true
    classpath = sourceSets.main.runtimeClasspath
}

task myJavadocs(type: Javadoc) {
    source = sourceSets.main
    tasks.withType(Javadoc) {
        options.addStringOption('Xdoclint:none', '-quiet')
        options.addStringOption('encoding', 'UTF-8')
        options.addStringOption('charSet', 'UTF-8')
    }
}
smac89
  • 39,374
  • 15
  • 132
  • 179

0 Answers0