建议将 Java 源代码从 1.4.2 升级到 1.6.0_10 吗?(跳过 1.5)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1466887/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java source upgrade from 1.4.2 to 1.6.0_10 recommended ? (skipping 1.5)
提问by coobird
Our desktop-only product at work has been using JDK 1.4.2 until now (also 1.4.2 JRE shipped with product). I am trying to convince the management to let us upgrade to a newer version in order to get the performance, API/features and developer comfort benefits.
到目前为止,我们的仅桌面产品一直使用 JDK 1.4.2(产品附带的 1.4.2 JRE)。我试图说服管理层让我们升级到更新的版本,以获得性能、API/功能和开发人员舒适度的好处。
Since 1.5 has reached EOL transition, I'm I thinking of the upgrade to 1.6.0_10 directly (update 10 chosen as it is a major one).
In terms of code, all compile errors are just variable names called enumwhich I have renamed and the product works fine.
由于 1.5 已经达到 EOL 过渡,我正在考虑直接升级到 1.6.0_10(选择更新 10,因为它是主要的)。在代码方面,所有编译错误都只是enum我重命名的变量名,并且产品运行良好。
The question is
问题是
- Whether this upgrade is recommended/fine i.e. skipping 1.5 ? are there any catches
- If yes then should I upgrade to 1.6u10 or the latest 1.6 available ?
- 此升级是否推荐/很好,即跳过 1.5 ?有什么问题吗
- 如果是,那么我应该升级到 1.6u10 还是可用的最新 1.6?
Thanks
谢谢
回答by Gandalf
I would say if you are going to do the upgrade then go for whatever the latest update is. You may actually get some free performance gains going with 1.6, I know some JVM improvements have been made since 1.4.
我会说,如果您要进行升级,那么无论最新的更新是什么。您实际上可能会在 1.6 中获得一些免费的性能提升,我知道自 1.4 以来已经进行了一些 JVM 改进。
回答by coobird
In general, Java is fairly good in being backwards compatible.
总的来说,Java 在向后兼容方面相当不错。
In case there is a need to find out what has changed in the Java platform from 1.4 to 6, the following is a list of changes that Sun has listed for each release:
如果需要了解 Java 平台从 1.4 到 6 的更改,以下是 Sun 为每个版本列出的更改列表:
回答by Michael Borgwardt
There's always a possibility that any specific release may contain a bug affecting you, or that your code depends on some unspecified behaviour of standard API classes that has since changed, but in general, upgrading to the latest Java release is recommended and relatively painless. You should of course test the product extensively on the new JRE.
总是有可能任何特定版本可能包含影响您的错误,或者您的代码取决于标准 API 类的某些未指定的行为,这些行为此后发生了变化,但总的来说,建议升级到最新的 Java 版本并且相对容易。您当然应该在新的 JRE 上广泛地测试产品。
回答by Vladimir Dyuzhev
Just did it (Swing app) from 1.3 to 1.6 :)
刚刚做到(Swing 应用程序)从 1.3 到 1.6 :)
Works (according to UAT testing) perfectly OK (except some changes required for awt UI). PTE shows some memory consumption reduction (not much), and the server side works somewhat faster (I tend to think it's due to GC improvements and string intern()).
工作(根据 UAT 测试)完全可以(除了 awt UI 需要进行一些更改)。PTE 显示出一些内存消耗减少(不多),并且服务器端的工作速度稍快一些(我倾向于认为这是由于 GC 改进和字符串 intern())。
In any case, you have to do it because of EOL, and 1.6 is not much different from 1.5. So I'd say 1.6 definitely.
无论如何,因为EOL,您必须这样做,并且1.6与1.5没有太大区别。所以我肯定会说1.6。
回答by akf
I would recommend upgrading to Java 6 over 1.5. As there would already be a need to test your app against the new JRE regardless of the version you choose, you may as well take advantage of this opportunity. Instead of incrementing your upgrade twice (once for 1.5 and later for 1.6) and requiring a test cycle twice, you can get it out of the way once. While you are at it, upgrading to the most recent version available would be perfectly fine.
我建议在 1.5 以上升级到 Java 6。由于无论您选择哪个版本,都已经需要针对新 JRE 测试您的应用程序,因此您不妨利用这个机会。与其将升级增加两次(一次用于 1.5,稍后用于 1.6)并且需要两次测试周期,您可以将其排除一次。当您使用它时,升级到可用的最新版本会非常好。
回答by ivan_ivanovich_ivanoff
It's Java, it's not a dirty scripting language which changes its syntactic, its grammar, and its API every minor release.
它是 Java,它不是一种肮脏的脚本语言,它会在每个次要版本中更改其句法、语法和 API。
Backward compatibility is one of the major features of Java.
向后兼容性是 Java 的主要特性之一。
回答by Pascal Thivent
Whether this upgrade is recommended/fine i.e. skipping 1.5 ? Are there any catches
此升级是否推荐/很好,即跳过 1.5 ?有没有问题
I think it's a good idea to skip 1.5 and go directly to 1.6 and there is absolutely no requirement that forces you to go through 1.5.
我认为跳过 1.5 直接进入 1.6 是一个好主意,绝对没有强制您通过 1.5 的要求。
If yes then should I upgrade to 1.6u10 or the latest 1.6 available ?
如果是,那么我应该升级到 1.6u10 还是可用的最新 1.6?
I'd go for the latest. Actually, I think 1.6u16 is the current major release.
我会去最新的。实际上,我认为 1.6u16 是当前的主要版本。
回答by Thorbj?rn Ravn Andersen
We recently upgraded our Swing-application (lots of drag and drop) from 1.4 to 1.6 to get the concurrent facilities, and we have not seen a single issue which is due to Java itself. We also want to go to the Nimbus Look and Feel since the Windows look and feel doesn't look and feel like Windows.
我们最近将我们的 Swing 应用程序(大量拖放)从 1.4 升级到 1.6 以获得并发设施,我们还没有看到由 Java 本身引起的任何问题。我们还想转到 Nimbus 的外观和感觉,因为 Windows 的外观和感觉不像 Windows。
The killer feature you should show your boss, is how to attach to the application using jvisualvm to introspect the running program in case of issues.
您应该向老板展示的杀手级功能是如何使用 jvisualvm 附加到应用程序以在出现问题时检查正在运行的程序。
回答by Yishai
Swing apps can definitely have issues version to version. We have had issues every upgrade (1.3 to 1.4 and 1.4 to 1.5 and we stuck our toe into 1.6 - and more issues). However, there is no reason to spend time on 1.5. Go straight to 1.6, the latest release, you won't be saving any time by going to 1.5, you will just spend a bunch of time testing on 1.5 and then do it again at some point in the future for 1.6. Much more economical to jump to 1.6.
Swing 应用程序肯定会有不同版本的问题。我们每次升级都会遇到问题(从 1.3 升级到 1.4,从 1.4 升级到 1.5,我们坚持到了 1.6 - 以及更多问题)。但是,没有理由花时间在 1.5 上。直接使用 1.6,最新版本,使用 1.5 不会节省任何时间,您只会花大量时间在 1.5 上进行测试,然后在将来的某个时候再次为 1.6 进行测试。跳到 1.6 更经济。
A lot of minor revisions fix issues, so sticking to 1.6_u10 is just inviting issues. u10 was a big upgrade (unlike its name implies) as far as Swing is concerned, and several of the releases after that addressed issues that came to light after u10 was released.
许多小的修订修复了问题,所以坚持 1.6_u10 只是引人入胜的问题。就 Swing 而言,u10 是一次重大升级(与其名称暗示的不同),之后的几个版本解决了 u10 发布后出现的问题。

