How to generate serialVersionUID
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.

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.







another way to generate serialVersionUID(only for jdk1.6 or higher) :
Thanks, helped me.
Hi,
In Eclipse wa can also do that for a set of classes :
ource Cleanup…->Custome Profile->Missing Code->Add serial version ID
Thx.
[...] You can use JDK “serialver” or Eclipse IDE to generate serialVersionUID automatically, see detail. [...]