Monday, February 26, 2007

Java warning - Serializable class without serialVersionUID


Problem: warning: [serial] serializable class XXXX has no definition of serialVersionUID

Solution: Two ways to get around this:
1. Add to compiling options: -Xlint:all,-serial (or)
2. Declare serialVersionUID in the code
Eg: public static final long serialVersionUID = 24362462L;

No comments:

Back to Top


 

Labels