You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Jeff <jt...@gmail.com> on 2020/02/03 21:40:53 UTC

Re: IntelliJ, language level and jigaw profile

Mark,

Glad to see that it worked for you.  I have more information stashed away
somewhere about how and why IntelliJ IDEA implicitly enables profiles, but
having Java 11 on your system and IDEA knowing about it seems to trigger
the implicit activation of the "jigsaw" profile.  You won't have the same
behavior through Maven on the command line unless you're building with Java
11, since the profile is set to auto-activate under that circumstance.
That may be why IDEA is implicitly activating it, even though you've set
the project to be built with Java 8.

It's a bit of a PITA to go through a build and then realize that the
"jigsaw" profile was implicitly checked.  I think there are some issues
filed about that kind of profile activation over at JetBrains, but I don't
think they've gotten much attention.

On Thu, Jan 30, 2020 at 9:19 AM Mark Bean <ma...@gmail.com> wrote:

> Found it. Profiles are at the top of the list in the Maven tool window.
>
> Thanks for the tip. Unchecking the jigsaw profile did the trick.
>
> Thanks,
> Mark
>
>
> On Thu, Jan 30, 2020 at 8:51 AM Mark Bean <ma...@gmail.com> wrote:
>
> > Jeff,
> >
> > Can you please be a little more specific where to find the light/bold
> > checked profile option? The only way I've enabled profiles is by explicit
> > maven option "-P".
> >
> > Thanks,
> > Mark
> >
> > On Wed, Jan 29, 2020 at 4:31 PM Jeff <jt...@gmail.com> wrote:
> >
> >> Hi Mark,
> >>
> >> IntelliJ IDEA seems to implicitly activate the "jigsaw" profile with a
> >> "light" checkmark if it thinks you have Java 11 installed versus a
> "bold"
> >> checkmark if you've clicked that profile to be enabled explicitly.  Make
> >> sure that profile is unchecked, and make IDEA rebuild.  That should get
> >> you
> >> back to having your classes compiled with Java 8.
> >>
> >> On Wed, Jan 29, 2020 at 4:23 PM Mark Bean <ma...@gmail.com>
> wrote:
> >>
> >> > I'm having trouble with IntelliJ setting the proper language level.
> Has
> >> > anyone else seen the following behavior?
> >> >
> >> > IntelliJ 2019.3.2 (Community Edition)
> >> > installed from ideaIC-2019.3.2-no-jbr.tar.gz
> >> >
> >> > File > Project Structure > Platform Settings > SDKs
> >> >   - Only 1.8 is loaded
> >> > File > Project Structure > Project Settings > Project
> >> >   - Project SDK = 1.8
> >> >   - Project language level = 8 - Lambdas, type annotations etc.
> >> > File > Project Structure > Project Settings > Modules
> >> >   - Every module lists "Language level" as "11 - Local variable syntax
> >> for
> >> > lambda paramters"
> >> > File > Settings > Build, Execution, Deployment > Build Tools > Maven >
> >> > Importing
> >> >   - JDK for importer = 1.8
> >> >
> >> > I go to File > Settings > Build, Execution, Deployment > Compiler >
> Java
> >> > Compiler
> >> >   - Project bytecode version = 8
> >> >   - Select all modules and remove them
> >> >   - Apply
> >> > From Project view, select root level pom.xml > Maven > Reimport
> >> > Return to File > Settings > Build, Execution, Deployment > Compiler >
> >> Java
> >> > Compiler
> >> >   - All modules have returned and have a Target bytecode version of 11
> >> >
> >> > At this point, I can't run unit tests in IntelliJ. I get an error
> >> "Error:
> >> > java: invalid source release: 11"
> >> >
> >> > I could just use Java 11, but I'm curious if this is related to the
> >> jigsaw
> >> > profile. When I remove the <activation> from the jigsaw profile, I get
> >> the
> >> > above behavior. When I remove both the activation and the properties
> >> > (maven.compiler.sorce and maven.compiler.target), then I can get the
> >> > language level to remain at 1.8.
> >> >
> >> > It appears the jigaw profile may be activating all the time. Or, maybe
> >> > IntelliJ is presenting the incorrect JDK version?
> >> >
> >> > -Mark
> >> >
> >>
> >
>