Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix toolchain resolving #664

Merged
merged 2 commits into from
Aug 23, 2023
Merged

Fix toolchain resolving #664

merged 2 commits into from
Aug 23, 2023

Conversation

virustotalop
Copy link

What's new

  • N/A

What's fixed

  • Automatic toolchain resolving

This adds automatic toolchain resolving for building, without this the build fails on Java 17 since it cannot resolve the toolchain. You can reference the gradle docs here for more information https://docs.gradle.org/8.2.1/userguide/toolchains.html#sub:download_repositories
@Col-E
Copy link
Owner

Col-E commented Aug 23, 2023

The dev3 branch resolves fine already. Can you explain what the purpose of this plugin is? And why are you using an outdated version when the latest is 0.7.0?

@virustotalop
Copy link
Author

virustotalop commented Aug 23, 2023

Good catch with the version, I just pulled the plugin from the gradle docs without checking the latest version. Without the toolchain resolver plugin the Java 8 jdk doesn't download to be used by the launcher module. I'm not sure if the Java version can be bumped to 11 and if the issue will be resolved but it is fixed with the toolchain plugin. Without the toolchain plugin the follow error occurs due to the jdk not downloading from the toolchain.

Build file 'C:\Users\vtotal\Documents\GitHub\Recaf\recaf-launcher\build.gradle' line: 44

* What went wrong:
A problem occurred evaluating project ':recaf-launcher'.
> Failed to calculate the value of task ':recaf-launcher:compileJava' property 'javaCompiler'.
   > No matching toolchains found for requested specification: {languageVersion=8, vendor=any, implementation=vendor-specific} for WINDOWS on x86_64.
      > No locally installed toolchains match and toolchain download repositories have not been configured.

* Try:
> Learn more about toolchain auto-detection at https://docs.gradle.org/8.2.1/userguide/toolchains.html#sec:auto_detection.
> Learn more about toolchain repositories at https://docs.gradle.org/8.2.1/userguide/toolchains.html#sub:download_repositories.
> 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.

Steps to reproduce

  1. Navigate to your .gradle directory
  2. Delete all the cached jdks in the jdks directory
  3. You should get the error above if you have Java 17 installed and no other jdks installed on the machine when running gradlew clean shadowJar

@Col-E
Copy link
Owner

Col-E commented Aug 23, 2023

Without the toolchain resolver plugin the Java 8 jdk doesn't download to be used by the launcher module.

Ah gotcha.

The plan for the launcher is to give that to users who otherwise would run into issues they're not technical enough to resolve themselves. So while 3X requires Java 11, the launcher on Java 8 could be used to warn you that you still need to update, without itself failing.

@Col-E Col-E merged commit 48e4220 into Col-E:dev3 Aug 23, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants