(SOLVED) How to generate serialVersionUID using Intellij IDEA

generate serialVersionUID using Intellij IDEA : In IntelliJ IDEA, we need to enable this auto-generate serialVersionUID option manually. P.S Tested with IntelliJ IDEA 2019.3.4, it should work the same in other versions.

Intellij IDEA Settings

File -> Settings -> Editor -> Inspections -> Java -> Serialization issues: Find serialization class without serialVersionUID and check it.

Back to the editor, clicks on the class name, ALT + ENTER (Windows), it will prompts the Add serialVersionUID field option.

A new serialVersionUID is auto-generated.

public class Address implements Serializable {

    private static final long serialVersionUID = -2338626292552177485L;



Marwen Mselmi
Author: Marwen Mselmi

Founder of Javatuto.com, love Java and open source stuff. Follow me on Linkedin.

Leave a comment