A new build and a new structured concurrency API

Remi Forax forax at univ-mlv.fr
Mon Nov 15 21:39:21 UTC 2021



----- Original Message -----
> From: "Eric Kolotyluk" <eric at kolotyluk.net>
> To: "Ron Pressler" <ron.pressler at oracle.com>
> Cc: "loom-dev" <loom-dev at openjdk.java.net>
> Sent: Lundi 15 Novembre 2021 22:18:34
> Subject: Re: A new build and a new structured concurrency API

Hi Eric,


> When I tried recompiling my project I get
> 
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile
> (default-compile) on project
> laboratory: Fatal error compiling: error: *invalid flag: --release 18* ->
> [Help 1]
> 
> I downloaded the latest release openjdk-18-loom+5-274_windows-x64_bin.zip
> and installed it, but no luck, and I downloaded
> openjdk-18-ea+23_windows-x64_bin.zip, but no luck.
> 
> $ "${JAVA_HOME}/bin/java" -version
> openjdk version "18-ea" 2022-03-15
> OpenJDK Runtime Environment (build 18-ea+23-1525)
> OpenJDK 64-Bit Server VM (build 18-ea+23-1525, mixed mode, sharing)
> 
> $ "${JAVA_HOME}/bin/java" -version
> openjdk version "18-loom" 2022-03-15
> OpenJDK Runtime Environment (build 18-loom+5-274)
> OpenJDK 64-Bit Server VM (build 18-loom+5-274, mixed mode, sharing)
> 
> <plugin>
>    <groupId>org.apache.maven.plugins</groupId>
>    <artifactId>maven-compiler-plugin</artifactId>
>    <version>3.8.1</version>
>    <configuration>
>        <compilerArgs>
>            <arg>--enable-preview</arg>
>            <arg>--release 18</arg>
>            <executable>C:/Program Files (Open)/jdk-18/bin/javac</executable>
>        </compilerArgs>
>        <compilerVersion>18</compilerVersion>
>        <source>18</source>
>        <target>18</target>
>    </configuration>
> </plugin>
> 
> Is there some other JDK I need?

I believe it's a Maven issue, release has its own tag in configuration,
something like:

  <configuration>
    <release>18</release>
    <source>18</source>
    <target>18</target>
    <compilerArgs>--enable-preview</compilerArgs>
  </configuration>

should work.

> 
> Cheers, Eric

regards,
Rémi

> 
> 
> 
> On Mon, Nov 15, 2021 at 12:22 PM Ron Pressler <ron.pressler at oracle.com>
> wrote:
> 
>> Hi.
>>
>> We have just published a new Early Access build of Project Loom over on
>> https://jdk.java.net/loom/
>>
>> The build is based on jdk-18+22, and now requires the --enable-preview
>> flag to
>> use Loom features (when compiling, remember to also add `--release 18`).
>>
>> The main new feature in this build is a new API for structured concurrency,
>> called StructuredExecutor. To learn more about its motivation,
>> capabilities,
>> and use, please read this JEP draft [1] and the Javadoc [2]. Pay special
>> attention to the new methods added to Future, resultNow and exceptionNow
>> [3], and how they complement StructuredExecutor. One of the most exciting
>> capabilities of StructuredExecutor is the new structured thread-dump
>> mentioned
>> in the JEP draft.
>>
>> Another new feature is the ability to use virtual threads as Cleaner
>> threads
>> [4]. We have also published a draft JEP for virtual threads [5]. The JEPs,
>> like
>> the project, are still a work in progress.
>>
>> As always, we appreciate feedback on these features from those who try
>> them.
>> Please, download the new EA and tell us about your experience.
>>
>> -- Ron
>>
>> [1]: http://openjdk.java.net/jeps/8277129
>> [2]:
>> https://download.java.net/java/early_access/loom/docs/api/java.base/java/util/concurrent/StructuredExecutor.html
>> [3]:
>> https://download.java.net/java/early_access/loom/docs/api/java.base/java/util/concurrent/Future.html
>> [4]:
>> https://download.java.net/java/early_access/loom/docs/api/java.base/java/lang/ref/Cleaner.html
>> [5]: http://openjdk.java.net/jeps/8277131
>>


More information about the loom-dev mailing list