Hi, I would like to know how I can build the project with the ./gradlew build command since at the moment it gives incompatibility messages "Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 8" Thank you.

Comment From: scottfrederick

Spring Boot 3.0 requires Java 17 at a minimum. The version of Java used to run the Gradle build must meet this minimum version requirement. It appears you are trying to build the project with Java 8. If that's not the case, please give more information about your build environment, including the Java version you are using to run Gradle.

Comment From: kalextaday

Yes, I developed with jdk 17 additionally in my build.gradle define source and target compatibility = 17, also gradle-wrapper.properties is with version 7.3

** build.gradle ***

plugins {
    id 'org.springframework.boot' version '3.0.2'
    id 'io.spring.dependency-management' version '1.1.0'
    id 'java'
}

group = 'com.tech.daemonio'
version = '0.0.1'
sourceCompatibility = 17
targetCompatibility = 17

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of( (17) )
    }
}

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'

    implementation 'org.springframework.boot:spring-boot-starter-validation'

    implementation 'io.github.kalextaday:jfilemanager:0.1.0'
}

tasks.named('test') {
    useJUnitPlatform()
}

tasks.withType(JavaCompile) {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

* end *

Comment From: scottfrederick

@kalextaday If you run java -version from the command line you are using to running Gradle, what is the output?

Comment From: kalextaday

Sure, java version "11.0.14" 2022-01-18 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.14+8-LTS-263) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.14+8-LTS-263, mixed mode)

Comment From: scottfrederick

The version of Java used to run a Gradle build that includes the Spring Boot Gradle plugin must be at least Java 17. You appear to be using Java 11.0.14 to run Gradle, which won't work. Please upgrade your Java version accordingly.