Using serialver command line tool to generate serialVersionUID

T

Trung Chinh Nguyen

Hi there,

I have a class named MyClass in a package named mypackage.
I want to generate a serialVersionUID for it.
The problem can be solved easily by using Eclipse. But unfortunately I
can't bring it with me all the time.
So I have found a command line tool called serialver that comes together
with the JDK.
However I have been trying to use this tool with no success :( Here's
what I have tried:
serialver MyClass -> Exception in thread "main"
java.lang.NoClassDefFoundError: MyClass (wrong name: mypackage/MyClass)
serialver mypackage/MyClass -> Class mypackage/MyClass not found.
serialver mypackage.MyClass -> Class mypackage.MyClass not found.

Please lend me a hand. Thank you.

Chinh
 
T

Trung Chinh Nguyen

Found the solution to my problem.
serialver -classpath "./" mypackage.MyClass does the job
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top