This post from SO that should answer your question. It even explains how to find the serial version automatically created by compiler if you didn't specify it (find serialver
in referenced page). Old articles can still be interesting ...
In short for the impatient :
- serialization automagically deals with new or removed members provided serialversion does not change
- IDEs or the
serialver
tool of the JDK can give you the serial version automatically generated by the compiler if you did not specify it
So you just have to find this serialversion, add the magic field static final long serialVersionUID = xx
and as you are only adding a member variable all should be fine.
(The referenced post is first answer from google for java serialization multiple versions
)