[External] : RE: A new build and a new structured concurrency API

Eric Kolotyluk eric at kolotyluk.net
Tue Nov 16 03:33:37 UTC 2021


I always run from IntelliJ because it's easier.
[image: image.png]

Normally I "Run" from the source tree, but IntelliJ seems broken now, so I
reported it as a defect to JetBrains.

In this case, laboratory.jar is an uber-jar created via the shade-plugin,
and generated by clicking the "package" goal in the Maven Lifecycle tab on
the right-hand side of the IntelliJ GUI. In this case, in the IntelliJ
Run->Edit Configurations... I edited the configuration under JAR
Application to put the "--enable-preview" in.

It's not as convenient as running from the source tree, but I hate using
the command line...

When I try using "17 (Preview)"I get...

java: invalid source release 17 with --enable-preview
  (preview language features are only supported for release 18)

Cheers, Eric


On Mon, Nov 15, 2021 at 6:52 PM Chris Plummer <chris.plummer at oracle.com>
wrote:

> How are you launching your app? I've never launched from Intellij. I only
> use it to compile and then to attach to an already running program. When
> launching you also need --enable-preview. If I haven't setup Intellij to do
> that, I would never have noticed. Trying it now... Yep, similar problem to
> yours, although for me I get an UnsupportedClassVersionErrror, and it says
> "Preview features are not enabled for Main. Try running with
> --enable-preview."
>
> I just found a work around. Instead of "X - Experimental Features", choose
> "17 (Preview)". That seems to get --enabled-previewed added. I've been on
> "X - Experimental Features" for 2 years now, because at one time it was
> needed, but all the new APIs got "preview" tags recently, so it looks like
> "17 (Preview)" works even though we are on 18.
>
> Chris
>
> On 11/15/21 6:37 PM, Eric Kolotyluk wrote:
>
> Yes, I did all those things before, but no luck.
>
>
>
> So far I used the shade-plugin to build an uber-jar, and on the JAR
> Application run configuration I have added “--enable-preview” to “VM
> options:” and that seems to work, but there is nothing I can do in the
> Application run configuration to make it work.
>
>
>
> Seems like a defect in IntelliJ somehow...
>
>
>
> Cheers, Eric
>
>
>
> *From: *Chris Plummer <chris.plummer at oracle.com>
> *Sent: *November 15, 2021 6:26 PM
> *To: *Eric Kolotyluk <eric at kolotyluk.net>; Remi Forax <forax at univ-mlv.fr>;
> loom-dev <loom-dev at openjdk.java.net>; Ron Pressler
> <ron.pressler at oracle.com>
> *Subject: *Re: A new build and a new structured concurrency API
>
>
>
> Under Settings -> Java Compiler, make sure you add --enable-preview to
>
> "Additional command line parameters".
>
>
>
> Under Project Structure -> Project Settings, make sure you choose "X -
>
> Experimental Features". Note my IntelliJ is a bit out of date. I assume
>
> at some point "18 (Preview) - Virtual Threads" will be made an option.
>
>
>
> Chris
>
>
>
> On 11/15/21 2:59 PM, Eric Kolotyluk wrote:
>
> > Okay, my next problem is that IntelliJ keeps complaining
>
> >
>
> >
> C:\Users\ERIC\Documents\git\loom-lab\laboratory\src\main\java\net\kolotyluk\loom\Experiment00.java:4:28
>
> > java: java.util.concurrent.StructuredExecutor is a preview API and is
>
> > disabled by default.
>
> >    (use --enable-preview to enable preview APIs)
>
> >
>
> > But I can find no way to convince IntelliJ to move forward. I have
> checked
>
> > both Setting and Project Structure, and put " --enable-preview "
> everywhere
>
> > I can think of. Is anyone else using IntelliJ with Loom?
>
> >
>
> > Cheers, Eric
>
> >
>
> > On Mon, Nov 15, 2021 at 1:52 PM Eric Kolotyluk <eric at kolotyluk.net>
> <eric at kolotyluk.net> wrote:
>
> >
>
> >
>
>
>
>
>


More information about the loom-dev mailing list