There are three ways to generate serialVersionUID for your serialization class.

1. serialver command

JDK has a build in command called “serialver” to generate the serialVersionUID automatically. In this example, you use “serialver” to generate a serialVersionUID for Address class.

E:\workspace\target\classes>serialver Address
Address:    static final long serialVersionUID = -687991492884005033L;

2. Use Eclispe IDE

Move your mouse over the serialization class.
serialVersionUID
Or Click on the serialization class and press “CTRL + 1″.

3. Anything you want

Just specify your own serialVersionUID , just give a number and append a “L” behind.

private static final long serialVersionUID = 1L;

Follow up

Understand the serialVersionUID and how to use it.