What does serialver do?

The JDK utility serialver displays the SUID for a class. The SUID is useful if you want to allow/disallow an older version of a serialized class to be deserialized to a newer version.
When serialization occurs, the class is first examined if it has a field static final long serialVersionUID. It it exists, it will write this value to the stream. If it doesn’t exist, it will generate a 64-bit hash (using the SHA algorithm on the classname, interface, methods and fields) and use that as the serialVersionUID to write to the stream.

Main.java:

import java.io.*;

public class Main implements Serializable {
   public static void main(String args[]) {
   }
}

after compiling this class: (note that a serialVersionUID has been included, because it was not specified)

C:>serialver Main
Main:    static final long serialVersionUID = 6106269076155338045L;

You can specify the serialVersionUID for versioning of serialized objects.

Main.java:

import java.io.*;

public class Main implements Serializable {
   static final long serialVersionUID = 1;
 
   public static void main(String args[]) {
   }
}

after compiling this class:

C:\>serialver Main
Main:    static final long serialVersionUID = 1L;