diff --git a/AGENTS.md b/AGENTS.md
index aef708e4e..a3560a114 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -5,6 +5,8 @@
Before preparing or publishing a release, read [`release.md`](release.md) completely. It is the authoritative release procedure and credential guide.
- Run Gradle on Java 17 or newer. The modules are compiled with a Java 8 toolchain, so the setup JAR runs on Java 8 and newer. Do not run Gradle itself on Java 8.
+- The tests are compiled and run with Java 17 or newer, as JUnit 6 needs it, so no automated test runs on Java 8.
+- Always try the built Robocode on Java 8 and on the newest Java before publishing, as described in Step 4 of `release.md`. `./gradlew release` publishes right after building, so do it before running that task.
- `./gradlew release` performs the local release flow: pre-flight checks, build, Maven Central publishing, Chocolatey publishing on Windows, GitHub Release creation, SourceForge publishing (setup JAR, README.md, default download, and `version.html`), and the blog post HTML. A failing step does not stop the independent steps, and a summary at the end lists the results and the manual steps (posting on Blogger and SourceForge news).
- With the local release, push `main` but not the version tag. `gh release create` makes the tag on GitHub; pushing the tag first starts the release workflow, which publishes too.
- Docker publishing is deliberately separate from the release task. Publish the RoboRumble image (`zamboch/roborumble`) with `./gradlew dockerPush` only when it is explicitly required.
diff --git a/buildSrc/src/main/kotlin/net.sf.robocode.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/net.sf.robocode.java-conventions.gradle.kts
index 7696bf62d..f7fbb04fc 100644
--- a/buildSrc/src/main/kotlin/net.sf.robocode.java-conventions.gradle.kts
+++ b/buildSrc/src/main/kotlin/net.sf.robocode.java-conventions.gradle.kts
@@ -23,10 +23,22 @@ java {
}
}
+// The product runs on Java 8, but JUnit 6 needs Java 17, so only the tests are compiled and run with Java 17 or newer
+val testJavaLanguageVersion = 17
+
+configurations.matching { it.name == "testCompileClasspath" || it.name == "testRuntimeClasspath" }.configureEach {
+ attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, testJavaLanguageVersion)
+}
+
tasks {
withType To run Robocode, Java 8 or a newer version must be installed on your system. Both the Java Runtime Environment (JRE) and
the Java Developer Kit (JDK) can be used. Note that the JRE does not include the standard Java compiler (javac) which
- comes with the JDK. However, Robocode comes with a built-in compiler ECJ (Eclipse Compiler for Java).
- Hence, it is sufficient to run Robocode with the JRE only.HISTORY OF ROBOCODE
SYSTEM REQUIREMENTS
Also, note that it is important that these environment variables have been set up before running Robocode:
JAVA_HOME must be set up to point at the home directory for Java diff --git a/robocode.content/src/main/resources/ReadMe.md b/robocode.content/src/main/resources/ReadMe.md index b416f2dbc..f115cd4a7 100644 --- a/robocode.content/src/main/resources/ReadMe.md +++ b/robocode.content/src/main/resources/ReadMe.md @@ -110,8 +110,9 @@ plugin, and the documentation files for it had got some serious issues that made To run Robocode, Java 8 or a newer version must be installed on your system. Both the Java Runtime Environment (JRE) and the Java Developer Kit (JDK) can be used. Note that the JRE does not include the standard Java compiler (javac) which -comes with the JDK. However, Robocode comes with a built-in compiler ECJ (Eclipse Compiler for Java). -Hence, it is sufficient to run Robocode with the JRE only. +comes with the JDK. However, Robocode comes with a built-in compiler ECJ (Eclipse Compiler for Java), which needs +Java 17 or newer. Hence, the JRE is enough to run Robocode, and with Java 17 or newer also to compile robots in the Robot +Editor. To compile robots with an older version of Java, use the JDK. Also, note that it is important that these environment variables have been set up before running Robocode: diff --git a/robocode.tests/build.gradle.kts b/robocode.tests/build.gradle.kts index 21ed3c860..36e1d2a79 100644 --- a/robocode.tests/build.gradle.kts +++ b/robocode.tests/build.gradle.kts @@ -17,6 +17,12 @@ dependencies { description = "Robocode Tests" +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + } +} + tasks { publishMavenJavaPublicationToSonatypeRepository { enabled = false