50

Since IntelliJ IDEA 2020.3.2 (I use Community Edition), I started getting:

Parsing java... [applicationname]
java: JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate.
Use build process "jps.track.ap.dependencies" VM flag to enable/disable incremental annotation processing environment.
Writing classes

warning, upon running the application within the IntelliJ IDEA.

This actually happens during the build phase, when you run your application for the "first" time (to be more precise, when target (or whatever you have configured as a building result directory) is being built).

What does this message mean?

Giorgi Tsiklauri
  • 9,715
  • 8
  • 45
  • 66

10 Answers10

29

As IDEA's build is incremental, it uses wrapper interfaces in order to collect some data that will help incremental analysis to correctly compile files affected by changes.

The -Djps.track.ap.dependencies=false option is added in: File > Settings/Preferences > Build, Execution, Deployment > Compiler. Then field Build process VM options disables collection of dependencies specified by an annotation processor when Filer methods are called.

In later versions of IntelliJ, the settings is now under: File > Settings > Build, Execution, Deployment > Compiler, then field Shared build process VM options

See some more details in this issue: IDEA-252069.

banan3'14
  • 3,810
  • 3
  • 24
  • 47
Andrey
  • 15,144
  • 25
  • 91
  • 187
  • 11
    Thank you for the answer; however, to me, this reads as a gibberish. Maybe you know the background context.. but not all do. Could you elaborate on what does it mean, that "IDEA's build is incremental"? what are "wrapper interfaces"? what for?.. what **some** data(this seems a new thing..) is IDEA collecting? – Giorgi Tsiklauri Feb 24 '21 at 13:07
  • 11
    Adding that flag does not fix it for me on IntelliJ 2020.3.2 Ultimate – Jire Feb 24 '21 at 18:01
  • 4
    @Giorgi Tsiklauri, in the latest IntelliJ version, the settings is now under _File | Settings | Build, Execution, Deployment | Compiler | Shared build process VM options_. It works for me. For your question about what does it mean, this issue happens only when you get some annotation processor like Lombok and is linked to the way IntelliJ handle incremental recompilation for what I understand. Why this option is not set by default? That is the question… – Doc Davluz Mar 04 '21 at 08:40
  • @DocDavluz - "*issue happens only when you get some annotation processor like Lombok*" - wrong. – Giorgi Tsiklauri Apr 19 '21 at 07:44
  • 2
    Working with IntelliJ 2021.1 version but after adding that flag IntelliJ should be reloaded and you should also run `mvn celan & install` in case of maven project. – Falcon Apr 21 '21 at 09:19
22

I was using an older version of Lombok, changing to newer version fixed the issue in IntelliJ

Old version:

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <optional>true</optional>
</dependency>

New version:

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.20</version>
    <scope>provided</scope>
</dependency>
banan3'14
  • 3,810
  • 3
  • 24
  • 47
loakesh bachhu
  • 323
  • 3
  • 4
8

In my case i was trying to use an old version lombok plugin (version 1.16.16), but it's an old plugin version, I updated to 1.18.20 (obs.: today is july 2021) and it works well.

3

I had to remove the target dir with rm -Rf ./target or mvn clean, then inside IntelliJIDEA's Maven panel, I clicked on the Icon "Reload all maven projects". I also tried to "Invalidate cache and restart". Not sure what was working but it solved my error.

Karl.S
  • 2,294
  • 1
  • 26
  • 33
  • I think this has nothing to do with the warning mentioned in the question.. problem arises at the compile time.. and `mvn clean` will just remove built directory. – Giorgi Tsiklauri Apr 28 '21 at 11:38
  • @GiorgiTsiklauri it does, since I had several times the exact same problem as described in the issue, and each time I solved it by doing one of the mentioned actions. Also it should be linked to IntelliJ only as I don't remember having this problem while running directly `mvn compile`. – Karl.S Apr 28 '21 at 17:42
  • No, it does not. `mvn clean` does nothing, but just removing the built project directory, which, in case of Maven project, happens to be `target`..so both of your actions do identical job. "*Also it should be linked to IntelliJ only*" - and the question is about IntelliJ only.. have s look at it.. see the tag of the question. – Giorgi Tsiklauri May 03 '21 at 06:16
  • 1
    It worked in my case. Thanks – Murad Hajiyev Apr 27 '22 at 01:08
2

I know the thread is almost 2 years old, but since this came up in search.

Fo me it worked after File->'Invalidate Caches...'

Becker Syd
  • 21
  • 2
1

We can do all operations in IntelliJ IDEA.

  1. add -Djps.track.ap.dependencies=false in proper place.
  2. In the right of IDEA, click Maven -> Reload All Maven Projects.
  3. Also in the Maven -> Excute Maven Goal (represented by a 'm' icon) -> mvn clean -> enter
  4. Then Excute Maven Goal -> mvn install -> enter
  5. Build -> Rebuild Project.

Thank Andrey, djangofan and Falcon.

lyx3030
  • 35
  • 1
1

1.New version added in pom.xml

enter code here
<dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.20</version>
        <scope>provided</scope>
</dependency>
enter code here

2.mvn clean -> build project

Roman Fu
  • 11
  • 2
1

In my case, In my case, upgrading the version of the Lombok package did not work.

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.26</version>
    </dependency>

it still shows the same error.

Parsing java... [applicationname]
java: JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate.
Use build process "jps.track.ap.dependencies" VM flag to enable/disable incremental annotation processing environment.
Writing classes

The compiler in the idea perferences panel adds the -Djps.track.ap.dependencies=false parameter.

enter image description here

it didn't work again.

I suspect the cache problem or something, I use the invalid cache under the file and restart it several times, but it doesn’t work.

Finally, the build runner turns on the delegate ide build/run actions to maven, and that's it. However, after it is turned on, it will be very slow when I run the project debug locally, and then turn it off again. Lombok did not report an error, so it was solved.

enter image description here

keith5140
  • 1,294
  • 1
  • 8
  • 11
0

In my case,the specific error is couldn't find one class file. I open it and find the suffix magically becomes '.aj'. Change it back to '.java'. It works for me.

张秋峰
  • 11
  • 3
0

This problem also comes when there is non compatible version of java installed on your system .

For my case i was working on debian Linux distro on Ubuntu 22.04 LTS but i installed ARM64 Compressed Archive

When i uninstalled above and installed x64 Compressed Archive

problem was solved .

In this case mvn --version did not worked either and was giving exec path error

Deepak
  • 2,287
  • 1
  • 23
  • 30