gradle ARM中的Kotlin构建

gr8qqesn  于 2022-11-14  发布在  Kotlin
关注(0)|答案(1)|浏览(210)

我正在尝试在Mac M1上运行build。我遇到了几个问题。当我运行构建脚本时,我得到:

* What went wrong:
Unable to calculate the value of the task ':compileJava' property 'javaCompiler'.
> Unable to download a toolchain that matches these requirements: {languageVersion=16, vendor=any, implementation=vendor-specific}
   > Unable to download the toolchain. This may indicate that the combination (version, architecture, release/early access, ...) for the required JDK is not available.
      > Could not read 'https://api.adoptium.net/v3/binary/latest/16/ga/mac/aarch64/jdk/hotspot/normal/eclipse' because it does not exist.

我安装了特定于arm的JDK并删除了JDE

Matching Java virtual machines (2):
    19 (arm64) "Oracle Corporation" - "Java SE 19" /Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home
    17.0.4 (arm64) "Amazon.com Inc." - "Amazon Corrected 17" /Users/Library/Java/JavaVirtualMachines/corrected-17.0.4.1/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home

我不知道为什么总是出错。我猜是因为手臂的结构,但我不知道怎么修复。有什么想法吗?

x33g5p2x

x33g5p2x1#

如果我逃跑

cat `which java` | file -

我发现实际上我有两个版本的Java:

/dev/stdin: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64eMach-O 64-bit executable arm64e]
(null) (for architecture x86_64):

所以我认为这可能是问题的原因之一。

相关问题