Re: serialver?
- From: "ducnbyu" <ducnbyu@xxxxxxx>
- Date: 28 Nov 2006 14:05:00 -0800
CapCity wrote:
OK, experienced developer, but new to Java (and eclipse, which is another
hurdle until I get used to it).
I inherited a project that has several classes that implement Serializable
and have a serialVersionUID variable. I created a new class that is a clone
of several of these existing ones and want to generate a serialVersionUID
for it. Looking on-line, I found several descriptions for serialver. I've
had no luck with it. I keep getting "class xxx not found" messages.
The file is a few folders deep, say src/dir1/dir2/dir3/myclass. From what
folder do I execute serialver and what do I use as the class name? The
package it belongs to would be dir1.dir2.dir3
Found an eclipse plug-in, but says the feature is "not available here", or
something like that.
I think an issue may be that these are all in .java files and not .class
files. But all the ones with serialVersionUIDs are .java files.
Also, do I need to generate a new one everytime the class changes?
BTW, the person who originally developed this doesn't remember how they were
generated.
Thanks!
Perhaps there's a better way, but...
In Eclipse when I clone a class that implements Serializable, to get a
new serial version number I delete the line that declares the serial
version UID and then a little plus-sign or something appears (maybe I
have to save to get this) next to the class declaration line... I think
I double-click that or right click it (I don't pay too much attention)
and I get a list of things to do, one of which is to create a new
serial version number UID. Selecting it recreates the line with a new
number.
.
- References:
- serialver?
- From: CapCity
- serialver?
- Prev by Date: Re: Newbie String Questions
- Next by Date: Re: Newbie String Questions
- Previous by thread: serialver?
- Next by thread: How to update a jar file for one source file change?
- Index(es):
Relevant Pages
|