Java 27 and 26: runnable demos and captured output for every JEP, plus version lanes
Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B38FGKKam5SCGgwgduVAh3
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// Gradle (build.gradle.kts): ask for a Java 25 toolchain
|
||||
plugins {
|
||||
java
|
||||
application
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(25))
|
||||
}
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("demo.App")
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.ankurm.demos</groupId>
|
||||
<artifactId>upgrade-demo</artifactId>
|
||||
<version>1.0</version>
|
||||
|
||||
<properties>
|
||||
<!-- Maven (pom.xml): keep all three in step. source and target set the language level and the class-file version; release also limits the API you may call -->
|
||||
<maven.compiler.source>25</maven.compiler.source>
|
||||
<maven.compiler.target>25</maven.compiler.target>
|
||||
<maven.compiler.release>25</maven.compiler.release>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
</project>
|
||||
@@ -0,0 +1 @@
|
||||
rootProject.name = "upgrade-demo"
|
||||
@@ -0,0 +1,12 @@
|
||||
package demo;
|
||||
|
||||
/**
|
||||
* The smallest class that proves a build targets Java 25: it prints the Java version of the JVM it runs on.
|
||||
* Explained in docs/15-build-files.md. The build files next to it (pom.xml, build.gradle.kts) are the ones
|
||||
* quoted in the "Step 1" section of the upgrade guide.
|
||||
*/
|
||||
public class App {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("running on Java " + Runtime.version().feature());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user