flathub / com.jetbrains.IntelliJ-IDEA-Ultimate

https://flathub.org/apps/details/com.jetbrains.IntelliJ-IDEA-Ultimate
15 stars 7 forks source link

Gradle: trust store file does not exist or is not readable (Temurin) #183

Closed DWolf-19 closed 5 months ago

DWolf-19 commented 5 months ago

I'm trying to use system installation of the Temurin JDK for IntelliJ. JDK

Everything seems to be working well, I set /run/host prefix in env variable and tell Gradle in my ~/.gradle/gradle.properties to find JDK in this variable. Env

But /run/host/usr/lib/jvm/temurin-21-jdk-amd64/lib/security is empty in the sandbox. When, for instance, I pressing button for some .class file from lib to download sources, I'm getting the following error:

Trust store file /run/host/usr/lib/jvm/temurin-21-jdk-amd64/lib/security/cacerts does not exist or is not readable. This may lead to SSL connection failures.
1 actionable task: 1 executed

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ijDownloadSources54693336-c80'.
> Could not resolve all files for configuration ':downloadSources_f13e9a2a-470c-479a-bdf0-bc4cc8a0cac2'.
   > Could not download lib-version-sources.jar (id:lib:version)
      > Could not get resource 'https://repo.maven.apache.org/maven2/id/lib/version/lib-version-sources.jar'.
         > Could not GET 'https://repo.maven.apache.org/maven2/id/lib/version/lib-version-sources.jar'.
            > Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

P.S. I use /run/host instead /var/run/host because after reloading the Gradle project automatically creates new JDK 8 with /run/host prefix (I use both 8 and 21 in my project, 8 for compilation only and 21 for everything else). Are there any differences with /var/run and /run? Kind of like /var/run is a symlink for /run (or not?).

x80486 commented 5 months ago

There are a couple of issues in this repository about this subject. Take a look at them, but usually this doesn't work. You would need to install the SDKs in your home directory (using SDKMAN, mise, etc.) or use the built-in extensions.

DWolf-19 commented 5 months ago

Ok, thanks. I decided to install JDKs from intelliJ to ~/.jdks in parallel with the system installation.