How to fix all files excluded from the project because of "Failed to calculate the value of task ':compileJava'" error?

Answered

Following the recommendations of All files are excluded in IntelliJ IDEA plugin template ticket, I have downloaded and specified the Amazon Corretto SDK for the my IntelliJ IDEA plugin:

Unfortunately, nothing has changed - I still have the error

Failed to calculate the value of task ':compileJava' property 'javaCompiler'.

Thus, all project files are still excluded:

What I have to do next?

1
10 comments

Please make sure to select JDK 17 in Settings | Build, Execution, Deployment | Build Tools | Gradle for Gradle JVM.

1

Yann Cebron

Thank you for the answer.

Unfortunately, zero-effect... 

The error has not changed:

Failed to calculate the value of task ':compileJava' property 'javaCompiler'.

No matching toolchains found for requested specification: {languageVersion=11, vendor=any, implementation=vendor-specific}.

According to error message, the language version 11 still presents somewhere in settings...

If you need to investigate please feel free to download repository with my plugin - currently there is no my own code there.

0

I checked out your repository as-is and was able to import it without any problems and run the plugin in the sandbox.

I would suggest to create a copy of your project directory and remove the hidden `.idea` directory from it and then use _File | New | Project from Existing Sources" pointing at that directory. It looks like something with the IDE configuration files might be messed up, and this would recreate them from scratch.

0

Yann Cebron

Re recreating of `.idea` directory was fixed the excluding of all files from the project, but the `Failed to calculate the value of task ':compileJava' property 'javaCompiler'.` error still presents. What else I need to check to fix this issue? Maybe `build.gradle.kts`? There is

kotlin {
jvmToolchain(11)
}

lines in this file.

0

I would delete the build directory. I found on a few occasions that cached/previously compiled data would mess up the gradle build until the build directory is deleted. It will be automatically created on the next gradle build action.

0

Vladimir Schneider

Thank you for the answer. 

Unfortunately, the deleting of the build directory has not changed anything.

I still have

Failed to calculate the value of task ':compileJava' property 'javaCompiler'.
No matching toolchains found for requested specification: {languageVersion=11, vendor=any, implementation=vendor-specific}.

error.

0

please try

kotlin {
jvmToolchain(17)
}
2

Yann Cebron

This is the solution. 

Thank you for the support!

0

Where to try 

kotlin {
  jvmToolchain(17)
}

?

0

safdafa In your Gradle build.gradle.kts file. 

1

Please sign in to leave a comment.