New posts
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# JDK: openjdk version "25.0.5" 2026-10-20 LTS
|
||||
$ javac --release 25 ScopeProbe.java
|
||||
ScopeProbe.java:1: error: StructuredTaskScope is a preview API and is disabled by default.
|
||||
import java.util.concurrent.StructuredTaskScope;
|
||||
^
|
||||
(use --enable-preview to enable preview APIs)
|
||||
ScopeProbe.java:6: error: StructuredTaskScope is a preview API and is disabled by default.
|
||||
try (var scope = StructuredTaskScope.open()) {
|
||||
^
|
||||
(use --enable-preview to enable preview APIs)
|
||||
2 errors
|
||||
$ javac --release 25 --enable-preview ScopeProbe.java
|
||||
Note: ScopeProbe.java uses preview features of Java SE 25.
|
||||
Note: Recompile with -Xlint:preview for details.
|
||||
$ java -cp preview-classes ScopeProbe
|
||||
Error: LinkageError occurred while loading main class ScopeProbe
|
||||
java.lang.UnsupportedClassVersionError: Preview features are not enabled for ScopeProbe (class file version 69.65535). Try running with '--enable-preview'
|
||||
$ java --enable-preview -cp preview-classes ScopeProbe
|
||||
security: ok | performance: ok
|
||||
Reference in New Issue
Block a user