如何以及为何更新 Web 应用程序?
当 Java1.6 取代了 Java 1.5 时,为什么我们应该更新在 Java 1.5 上运行的应用程序?我们该怎么做?
Why should we update an application running on Java 1.5 when Java1.6 has replaced Java 1.5 ?How do we do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最终 Java 5 将达到生命周期的终点。这将是开始在 Java 6 上运行它的一个很好的理由。
我想,瞄准受众最多的平台也是明智之举。
许多应用程序在这两个平台上都运行良好。如果您的应用程序依赖于 Java 5 中已停止使用的功能,我会考虑重写它以支持未来的 Java 平台。
怎么做呢?您确定您需要做任何事情吗?除非它使用已停止的 api,一个简单的重新编译最多就可以了。另请注意有关使用已弃用的 api 的任何警告。它们可能会在 Java 的未来版本中消失。
Eventually Java 5 will reach end of life. That would be a good reason to start running it on Java 6 instead.
Also it'd be smart to target the platform with the largest audience, I'd suppose.
Many applications run fine on both platforms. If your app is depending on a discontinued feature in Java 5 I'd consider rewriting it to support future Java platforms.
How to do it? Are you sure you need to do anything at all? Unless it's using disconntinued api's a simple recompile would do ... at most. Also be aware of any warnings about using deprecated api's. They may disappear in a future version of Java.
您应该询问任何告诉您使用 Java 5.0 的人。如果这是您的应用程序唯一支持的 Java 版本,您可能必须使用它。
您可能应该选择 Java 6(这可能是最好的选择)。
Java 7 可能会在今年发布,如果您有一个应用程序在一段时间内不会发布,您可以从一开始就使用 Java 7 来开发它。
但是,如果应用程序可以工作并且您不需要更改它,为什么不保持原样。
这取决于您的情况和您的要求,什么是最好的版本。
You should ask anyone who is telling you to use Java 5.0. If that is the only supported Java version for your application, you may have to use it.
You should probably take Java 6 (this is likely to be the best choice).
Java 7 is likely to be released this year and if you have an application which won't be released for some time, you could develop it using Java 7 from the start.
However if the application works and you don't need to change it why not just leave it as is.
It depends on your situation and your requirements as to what is the best version to use.
使目标计算机上的运行时保持最新是个好主意。除此之外,运行旧版本还会带来安全隐患。这可能根本不需要您修改代码。您可能使用了已被删除的 API,或者您依赖于被视为错误/安全缺陷的行为,但我认为这些情况相对较少。
至于是否更新开发环境以使用最新的 JDK,这取决于您是否想要使用最新的功能等。并且请记住,旧的 JVM 可能无法运行针对较新版本的编译的代码爪哇。
It's a good idea to keep the runtime up-to-date on the target machine. Amongst other things there are security implications of running old versions. This probably won't require you to touch your code at all. It might be that you've used a API that has been dropped or you've relied on behaviour that was deemed to be a bug/security flaw, but I think those circumstances are relatively rare.
As to whether you update your development environment to use the latest JDK, it depends on whether you want to use the latest features, etc. And bearing in mind that an old JVM may not be able to run code compiled against a more recent version of Java.