在 Gradle 构建文件中
if(JavaVersion.current() != JavaVersion.VERSION_1_8) throw new GradleException("This project requires Java 8, but it's running on"+JavaVersion.current()) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
这是错误的描述
The supplied phased action failed with an exception. A problem occurred configuring root project 'IntroToUnitTesting'. A problem occurred evaluating root project 'IntroToUnitTesting'. This project requires Java 8, but it's running on 18