serialVersionUID
Blank boys I ask you an aid a lot important. I am realizing a written graphical application in java. Until a sure point when I compiled it went well tuto. To improviso when the plan has grown and the compilations they have become more frequent are introduces 23 warning very to you of the type: has not definition of serialVersionUID. Turning in net I have understood that this warning has had to the clasi that implement the interface serialize but also I have understood that second me this a lot warnin is not but it is a true error and I explain you the perk? Once compiled there are these 23 warning if I make to leave the application from my system (linux) the application has all till now the programmed potentialities while if I distribute the application to a friend who ago to turn on not present Mac OS X this all the potentialities. If but I take to the code of the plan and I give it he making to compile it on susa the machine when the programmed potentialities send it in execution the software have all. Hour the solution that I have found or that better all say but without to explain the perk?truly is that one to insert in the classes that a field public static final long serialVersionUID=lNumeroL with valare gives to this warning to appeals to and to change to this every number time that is carried out one modification of a sure weight to the class. Hour which I ask to you if my problem is this and if it is right to give a number to it appeal to to a property that would have then to be task of the compiler and above all that it means to change the number to every modification of a sure type? I that I believe that a modification is a modification and modifications of a sure weight and others of an other weight do not exist. I hope that someone can help me. Excused for my English orribile.
I'm sorry but I have to say that I have some problems in understanding that. Can you write a shorter text with a small sample?Do you use serialization? (RMI?). You can just set serialVersionUID to e.g. 1 if you aren't or if you don't care about version
i'm creating a java graphic application. I hadn't problems until the project grew up and the compilations became more frequent. I had 23 warnings : 'has no definition of serialVersionUID'. Surfing the net i understood this warning is about serialize classes ,but it seems it is a real error.
I explain : When i compile, these 23 warnings appear but all works fine on my pc (linux) but when i try on a mac some features of the application doesn't work.
Someone can help me? Thanks Guys!
> but when i try on> a mac some features of the application doesn't work.Which features exactly?What kind of errors do you get?
after compilation on mac some JinternalFrame doesn't' appear when i click on the menu while on linux (where i'm developing) they appear correctly.I get no errors, only warnings.
Doesn't seem related to serialization.More like a problem porting UI on the Mac:[url= http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac/]Bringing your Java Application to Mac OS X[/url].
> i'm creating a java graphic application. I hadn't
> problems until the project grew up and the
> compilations became more frequent. I had 23 warnings
> : 'has no definition of serialVersionUID'. Surfing
> the net i understood this warning is about serialize
> classes ,but it seems it is a real error.
No, it's a warning.
> I explain : When i compile, these 23 warnings appear
> but all works fine on my pc (linux) but when i try on
> a mac some features of the application doesn't work.
Are you sure that the Mac is running the correct Java version?
Kaj
thanks for helping.
the problem of JInternalFrame is born after warnings appear. Before all work fine on both platforms , so i don't think there 's a problem with mac java version. Anyway these are the result of java -version command :
linux
java version "1.5.0_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
Java HotSpot(TM) Client VM (build 1.5.0_08-b03, mixed mode, sharing)
mac
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-164)
Java HotSpot(TM) Client VM (build 1.5.0_07-87, mixed mode, sharing)
Are you using serialization?
No, in effect it's strangeI don't understand the problem.
> No, in effect it's strange> I don't understand the problem.Are all the warnings you get related to serialization?What other things have changed since the last time it worked?
I added two JInternalFrame . One of the warning is : warning: [serial] serializable class sistemagestionaleintegrato.ModClient has no definition of serialVersionUID
> I added two JInternalFrame . One of the warning is :> warning: [serial] serializable class> sistemagestionaleintegrato.ModClient has no> definition of serialVersionUIDThat's not a problem.Kaj