From 3a33d5e0ada272871c000085a2bbd27ef55cdad6 Mon Sep 17 00:00:00 2001 From: Vest Date: Sun, 5 Jul 2026 22:29:58 +0200 Subject: [PATCH] Require JDK 25 with an actionable pre-flight error; drop legacy 6.08 docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit build.gradle: install a taskGraph.whenReady hook that resolves the Java toolchain before any JavaCompile task runs. On failure, replace Gradle's "Toolchain download repositories have not been configured" message with the daemon's current version, its java.home, four vendor download links, and the exact -Porg.gradle.java.installations.paths invocation. Non-compile tasks (help, tasks, javaToolchains) are unaffected, so newcomers can still introspect their setup. README.md: master ships 6.09 — drop the parallel 6.08 install path (JDK 11 recommendation, separate TOC entry, "6.09 (Alpha)" qualifier on the remaining install section) and simplify the dev-Java line to just name JDK 25. --- README.md | 34 +++++++++------------------------- build.gradle | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 1780efd4215..fd1b8dee22d 100644 --- a/README.md +++ b/README.md @@ -10,36 +10,21 @@ It supports numerous game systems, most notably: - Starfinder # Table of Contents -1. [Installing From Release 6.08](#installing-from-release-608) +1. [Installing PCGen](#installing-pcgen) -2. [Installing From Release 6.09 (Alpha)](#installing-from-release-609-alpha) +2. [PCGen Needs You](#pcgen-needs-you) -3. [PCGen Needs You](#pcgen-needs-you) +3. [The Old Wiki](#the-old-wiki) -4. [The Old Wiki](#the-old-wiki) +4. [PCGen LST Tutorial](#pcgen-lst-tutorial) -5. [PCGen LST Tutorial](#pcgen-lst-tutorial) +5. [Basic Workflow](#basic-workflow) -6. [Basic Workflow](#basic-workflow) +6. [Development Setup](#development-setup) -7. [Development Setup](#development-setup) +7. [Essential Gradle Tasks](#essential-gradle-tasks) -8. [Essential Gradle Tasks](#essential-gradle-tasks) - -# Installing From Release 6.08 -1. Install Java. - - JDK 11 is recommended and has long term support, later versions should also work. 10 and below are not supported. - - To check if you have Java installed, see [Install Java](#install-java) - - If you don't have it already, you can get it from [Eclipse Temurin](https://adoptium.net/temurin/releases/?version=11). - -2. Download and extract the full zip file from https://github.com/PCGen/pcgen/releases/latest. - -3. You should now be able to run PCGen. The exact invocation depends on your operating system, but you should be able to either double-click to launch the file for your platform. - - Windows: `pcgen.exe` (`pcgen.bat` for command-line users) - - Linux: `pcgen.sh` - - Mac: `pcgen.jar` (or `pcgen.dmg` if it exists) - -# Installing From Release 6.09 (Alpha) +# Installing PCGen > Note: Java does not need to be preinstalled with PcGen >6.09.05 ## Using Zip bundle @@ -111,8 +96,7 @@ Check the installed version with: java -version -For 6.08 development you will want Java with a minimum version of 11. -For 6.09 development you will want Java with a minimum version of 25. +For development you will want Java with a minimum version of 25. You can install the latest version from [Eclipse Temurin](https://adoptium.net) regardless of your OS, please see instructions there. ### Install Git diff --git a/build.gradle b/build.gradle index b1975b0711e..0970f8b4531 100644 --- a/build.gradle +++ b/build.gradle @@ -79,6 +79,36 @@ java { } } +// Replace Gradle's opaque toolchain error with an actionable message. +gradle.taskGraph.whenReady { graph -> + def needsCompile = graph.allTasks.any { it instanceof JavaCompile } + if (!needsCompile) return + + try { + javaToolchains.launcherFor(java.toolchain).get() + } catch (Exception e) { + throw new GradleException(""" + + PCGen requires JDK ${javaVersion} to build, but Gradle could not + find one on this machine. + + Currently running: Java ${System.getProperty('java.version')} + at ${System.getProperty('java.home')} + + Install JDK ${javaVersion} (or newer) and either: + - Set JAVA_HOME to it, or + - Run: ./gradlew -Porg.gradle.java.installations.paths= + + Verify Gradle can see it: ./gradlew -q javaToolchains + + Downloads: + - Adoptium Temurin: https://adoptium.net/temurin/releases/?version=${javaVersion} + - Azul Zulu: https://www.azul.com/downloads/?version=java-${javaVersion}-lts + - SapMachine: https://sapmachine.io/ + """.stripIndent(), e) + } +} + application { mainClass.set('pcgen.system.Main') }