我已经开始使用GitHub操作实现CI-CD,并将lint集成到main.yml中,但我收到如下错误:
Run ./gradlew lintDebug
Downloading https://services.gradle.org/distributions/gradle-8.0-bin.zip
...........10%............20%............30%............40%............50%............60%...........70%............80%............90%............100%
Welcome to Gradle 8.0!
For more details see https://docs.gradle.org/8.0/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* Where:
Build file '/home/runner/work/ci-cd-example/ci-cd-example/app/build.gradle.kts' line: 1
* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.application'.
> Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
Your current JDK is located in /usr/lib/jvm/temurin-11-jdk-amd64
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 22s
Error: Process completed with exit code 1.
我已经将JAVA_HOME更改为Java版本17. 以下是版本详细信息.这是在终端中应用命令"Java-Version"获得的(我使用的是MAC)
openjdk version "17.0.8.1" 2023-08-24
OpenJDK Runtime Environment Homebrew (build 17.0.8.1+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.8.1+0, mixed mode, sharing)
我还判断了Gradle JDK版本的代码,它也是用JAVA_HOME设置的.
在这里,我想知道哪个JDK GitHub运行main.yml文件,并且我可以更改GitHub操作的JDK配置.