锁定老帖子 主题:Eclipse 3.1 Release
精华帖 (0) :: 良好帖 (0) :: 灌水帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2005-06-29
|
|
返回顶楼 | |
发表时间:2005-06-29
我安装了Eclipse3.1以后,所有的实现java.io.Serializable接口的类统统报告警告信息:
引用 The serializable class XXXX does not declare a static final serialVersionUID field of type long
点击提示,Add default serial Version ID,生成 private static final long serialVersionUID = 1L; 这是怎么回事,谁知道? |
|
返回顶楼 | |
发表时间:2005-06-30
Serial Version UID There is a new optional compiler diagnosis for serializable classes missing a declaration of a serialVersionUID field. The preference setting can be found at Java > Compiler > Errors/Warnings > Potential programming problems 不知道老大说的是不是这个? |
|
返回顶楼 | |
发表时间:2005-06-30
是的,找到了一个说法:
http://java.sun.com/j2se/1.4/compatibility.html 引用 If a serializable nested class contains explicit references to a class object (for example, "Foo.class"), then the computed value of the default serial version UID for both the nested class and its enclosing class will be different in J2SE 1.3 and J2SE 1.4. The difference is due to the fact that the computation of the serial version UID is sensitive to modifications made in the javac compiler between J2SE 1.3 and J2SE 1.4.
To avoid this problem affecting your applications, we recommend that you add an explicit serial version UID to your serializable classes. You can use the serialver tool to obtain the serial version UID of classes compiled with the J2SE 1.3 javac compiler. |
|
返回顶楼 | |
发表时间:2005-06-30
jdk 5 比 jdk 1.4 快,sun 说的
jdk 5 可以兼容 jdk 1.4,sun 说的 eclipse 3.1 比 eclipse 3.0 快很多,第一个新特性就提这事 eclipse 3.1 可以在 jdk 1.4 上跑,eclipse 说的 |
|
返回顶楼 | |
发表时间:2005-06-30
zgd 写道 jdk 5 比 jdk 1.4 快,sun 说的
我在两路Xeon服务器上面用JVM测试程序测试过了,操作系统环境为SuSE Linux Professional 9.1/Kernel 2.6.5,测试结果表明,JDK5不比JDK1.4.2快多少,考虑测试允许的误差,可以说JDK5性能没有任何提高。 不谈服务器环境,就拿我的笔记本电脑来说,跑Eclipse3.0,如果是JDK1.4.2就很流畅,如果换成JDK5.0,就出现明显的迟滞! Sun的谎言! |
|
返回顶楼 | |
发表时间:2005-06-30
我在JDK 1.5上跑Eclipse还没什么感觉,不过发现tomcat 5.5.9有时候会有停滞的现象,以前用jdk 1.4.2的时候还没这个感觉?
按道理说tomcat 5.5以上是专门为jdk 1.5设计的,不应该有这个问题才对。反倒是在1.4上运行tomcat 5.5的时候需要加装一个compat包。 |
|
返回顶楼 | |
发表时间:2005-06-30
引用 The If a serializable nested class contains explicit references to a class object (for example, "Foo.class"), then the computed value of the default serial version UID for both the nested class and its enclosing class will be different in J2SE 1.3 and J2SE 1.4. The difference is due to the fact that the computation of the serial version UID is sensitive to modifications made in the javac compiler between J2SE 1.3 and J2SE 1.4.
To avoid this problem affecting your applications, we recommend that you add an explicit serial version UID to your serializable classes. You can use the serialver tool to obtain the serial version UID of classes compiled with the J2SE 1.3 javac compiler. 意思是在1.3和1.4中编译器的一些不同,会导致default serial version UID的计算不一样。 然后程序会出错? 所以得自己加serial version UID? |
|
返回顶楼 | |
发表时间:2005-06-30
我前几天用的RC4,jre用1.5update3,感觉eclipse的速度快了很多亚。赶快下一个3.1realese的试一下。
|
|
返回顶楼 | |
发表时间:2005-06-30
试了一下public enum发现3.1仍然不认识这个语法,是不是哪里需要设置?
ps, 那个serialID真的很恶心。sun在搞什么? |
|
返回顶楼 | |