Help us understand the problem. What is going on with this article?

STSでlombokがエラーになった時

STSを開いた時にlombokのコードがエラーになる現象が度々起こり、都度対応を忘れるので備忘録。
元々動いていたプロジェクトが動かなくなった時の対応といった感じです。

エラー

下記のようなエラーが100件くらい出る。

ani cannot be resolved or is not a field
Java Problem

環境

Java11(jdk-11.0.1)
Spring Tool Suite 3.9.6.RELEASE

やったこと

1. STSにJava11のプラグインをインストール

Eclipse MarketPlaceから「Java 11 Support for Eclipse 2018-09 (4.9)」をインストール。

2. STSのJava Compilerの参照先をjdk11に変更
  • 設定画面を開く

[Window] -> [Preferences] -> [Java]

  • JRE追加

-> [Installed JREs] -> [Add] -> 「Standard VM」選択 -> JRE
homeでjdk11のパスを設定 -> [Add External Jar] -> [Finish]

  • Compiler設定

-> [Compiler]

Compiler compliance level、GEnerated.class files compatibility、Source compatibilityの3カ所を「11」に設定する。

3. lombok.jar再インストール
4. Maven Update Project

Mavenを使っていたので[Maven] -> [Update Project]

STSというかJava11で怒られていたのをどうにかしたという話。

発生したタイミング

  • STS起動時
  • Project Clean時
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away