jdk.compiler/sun.tools.serialver.SerialVer - "serialver" Command

Q

How to run "serialver" command from JDK lib\modules JImage file?

✍: FYIcenter

A

"serialver" command allows you to load a Java class and prints its the serialVersionUID.

"serialver" command is supported by the jmods\jdk.compiler.jmod module file, which is also linked into the lib\modules JImage file in JDK 9, 10, and 11.

You can run the "serialver" command using the lib\modules JImage file as described below using JDK 11 as an example:

C:\fyicenter>set JDK_HOME=\fyicenter\jdk-11.0.1

C:\fyicenter>%JDK_HOME%\bin\java --module jdk.compiler/sun.tools.serialver.SerialVer java.lang.String

java.lang.String:    private static final long serialVersionUID = -6849794470754667710L;

 

jdkjdk.hotspot.agent/sun.jvm.hotspot.tools.HeapDumper - JVM Heap Dumper

jdk.compiler/com.sun.tools.javac.Main - "javac" Command

Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2019-09-27, 290👍, 0💬