JetBrains / intellij-platform-plugin-template

Template repository for creating plugins for IntelliJ Platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build.yml reports "Cannot find a Java installation"

InSyncWithFoo opened this issue · comments

This workflow failed, saying it found no Java installation vendored by JetBrains:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'pyright'.
> Failed to calculate the value of task ':compileJava' property 'javaCompiler'.
   > Cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=17, vendor=JETBRAINS, implementation=vendor-specific} for LINUX on x86_64.
      > No locally installed toolchains match and toolchain download repositories have not been configured.

The commit that triggered the workflow only changed the workflow file by a tiny bit: it added chmod +x ./gradlew. How does the same workflow for this template work? setup-java doesn't support JetBrainsRuntime.

I have tried creating a new repository using this template for about 20 times. The results are indeterministic: sometimes it fails, sometimes it succeeds, even with the same content and the same settings. For example, this repository, which was generated from the template rather than manually created, had the workflow running normally.

It seems that the following lines are necessary:

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

The result is possibly cached, which allows later runs to succeed.