Joe
Joe

Reputation: 1

generate serialVersionUID automatically in intellij stopped working

I've managed before to generate serialVersionUID automatically in IntelliJ IDEA by both installing the plugin GenerateSerialVersionUID and enabling the checkbox in settings - code - inspection like prior answers to this questions said. I can't let this go, anyone? I have EE 2016.1.3. I've tried all the answers here. What I'm after is the warning, i.e IntelliJ lets me know that I should provide serialVersionUID. Generate it is bonus.

Upvotes: 0

Views: 4306

Answers (3)

Narender G
Narender G

Reputation: 1

I encountered the problem and solved it

File->settings->editor->inspections->JVM Languages->Serializable class without serialVersionUID (check the box)

Click on Apply and Ok the changes will be refelcted.

Upvotes: 0

Lucas Guimaraes
Lucas Guimaraes

Reputation: 3

As mentioned by Vu Nguyen here in the comments, for IDEA 2022.1 (Community and Ultimate versions) the warning can be enabled at:

Settings → Editor → Inspections → JVM Language → Serializable class without SerialVersionUID

Or simply use the search option:

  1. press CTRL + SHIFT + A
  2. write/paste: "Serializable class without SerialVersionUID"

Upvotes: 0

Vojtech Ruzicka
Vojtech Ruzicka

Reputation: 17075

You can enable the warning by going to

Settings → Editor → Inspections → Java → Serializable class without SerialVersionUID

enter image description here

Then, when this is enabled, you can generate missing SerialVersionUID by clicking on the lightbulb icon (or Alt+Enter). Is is generated for you automatically. You do not need any plugins for that. If it is still not working you may try to uninstall your plugin as it may interfere with built-in functionality.

enter image description here

Upvotes: 4

Related Questions