LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

serialver

Compute Java serialization version UID

TLDR

Get serial version UID
$ serialver [ClassName]
copy
With classpath
$ serialver -classpath [path] [ClassName]
copy
Show for JAR class
$ serialver -classpath [app.jar] [com.example.MyClass]
copy

SYNOPSIS

serialver [-classpath path] [options] classname

DESCRIPTION

serialver computes and displays the serialVersionUID for Java classes that implement the Serializable interface. This UID is a hash derived from the class structure (fields, methods, interfaces) and is used by Java's serialization mechanism to verify that sender and receiver of a serialized object have compatible class definitions.When a class does not explicitly declare a serialVersionUID, the JVM computes one automatically at runtime. Using serialver to obtain and hardcode this value in the class source prevents incompatible class version errors when the class structure changes in ways that remain compatible with older serialized forms.

PARAMETERS

-classpath PATH

Class search path.
-J FLAG
Pass option to the Java runtime (e.g., -J-Xms48m).
-show
Show GUI inspector (removed in modern JDK versions).

CAVEATS

Class must implement Serializable. JDK required. The -show GUI mode has been removed in recent JDK versions.

HISTORY

serialver is part of the Java Development Kit, providing serial version UID computation for Serializable classes.

SEE ALSO

java(1), javac(1), jar(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid