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') }