Community
Participate
Working Groups
Here are two simple classes which present incompatibility between Sun and eclipse compilers. public class SerializationTest implements Serializable { private void dummy() { Class c = String.class; } } public class Test { public static void main(String[] args) { Class c = SerializationTest.class; ObjectStreamClass osc = ObjectStreamClass.lookup(c); System.out.println("serialVersionUID for " + c + " is " + osc.getSerialVersionUID()); } } These classes compiled with Sun compiler produce other result than when compiled with eclipse compiler. I suppose the reason of this behavior is that both compilers create static variable of Class type but 1. Sun calls it class$java$lang$String 2. eclipse calls it class$0 3. Sun also creates a method with "static Class class$(String s)" signature Regards Luke
This is not a bug in the Eclipse compiler. If you want to use the default serialization, you should provide the serialVersionUID private field. If you don't, you depend on the compiler used to compile your class. Search for serialization in bugzilla for other bug reports related to the same issue. *** This bug has been marked as a duplicate of 10104 ***