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.
Asked
Active
Viewed 3,339 times
2 Answers
4
You can enable the warning by going to
Settings → Editor → Inspections → Java → Serializable class without SerialVersionUID
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.

Vojtech Ruzicka
- 16,384
- 15
- 63
- 66
-
Thanks for answer..As I said this was the first thing I tried and it worked. Now it doesn't and I've tried with and without plugin.... – Joe Jun 24 '16 at 16:27
-
Is the class actually implementing serializable? Are there any other plugins which may interfere with inspections? Don't you have inspections off in general or power-saving mode on? Did you try "Invalidate Caches and restart?" – Vojtech Ruzicka Jun 24 '16 at 16:43
-
Yes, no, no and yes. But thank you all for your answers. When I checked the box in inspections I found it by searching and the box I checked was not under Java, but AndroidLint.. So now it's working! – Joe Jun 25 '16 at 13:51
-
Glad it worked. In that case you might want to accept the answer as it is the preferred way to configure the inspection for users who come here with simliar problem. Thanks. – Vojtech Ruzicka Jun 25 '16 at 14:03
-
2For IntelliJ IDEA 2022.1. EAP (Ultimate), it's under "JVM Language" setting, not under "Java"; hope this helps someone with the same version. – Vu Nguyen Feb 01 '22 at 17:28
0
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:
- press CTRL + SHIFT + A
- write/paste: "Serializable class without SerialVersionUID"

Lucas Guimaraes
- 3
- 2