将现有Java Project从Java 1.6升级到1.8 [英] Upgrading existing Java Project from Java 1.6 to 1.8

查看:1085
本文介绍了将现有Java Project从Java 1.6升级到1.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我被分配到一个任务,我必须将现有的独立Java应用程序从 Java 1.6 升级到 Java 1.8

我还没有完成代码,我对这个项目一无所知。

Recently I was assigned to a task wherein I have to upgrade the existing standalone java application from Java 1.6 to Java 1.8.
I'm yet to go through the code and I have no idea about this project.

他们使用的是
ANT 1.6.1,

AXIS 1.5.1,

ABINITIO 2.15,< br>
ORACLE 11.1.0.7,

AUTOSYS R11,

Java 1.6。

They were using ANT 1.6.1,
AXIS 1.5.1,
ABINITIO 2.15,
ORACLE 11.1.0.7,
AUTOSYS R11,
Java 1.6.

I首先我需要确定上面提到的工具/框架是否与Java 1.8兼容。

I got to know that first I need to identify whether the above mentioned Tools/Frameworks are compatible with Java 1.8.

请建议我在编译和构建应用程序时遇到的其他挑战是什么?

Please suggest what are the other challenges I might encounter while compiling and building the application?

推荐答案

虽然Java应该在版本之间向后兼容,但是众所周知,任何语言的向后兼容性并不像名称所暗示的那样直截了当。一些(大多数)项目发布了专门针对一个或另一个开发工具包编译的libs版本,以利用语言中添加的新功能和增强功能。

Although Java is supposed to be backward compatible between versions, it's also known that backward compatibility in any language isn't aways as straight forward as the name suggests. Some (most) projects release it's libs versions compiled specifically targeting one or another development kit, to take advantage of new features and enhancements added to the language.

话虽如此,我相信更聪明的方法是:首先,更新项目的JDK,并针对新的字节码版本重新构建它。您可能需要升级Ant和(如果这是您选择的IDE)Eclipse(请参阅此处原因) )。

That being said, I believe the smarter way to go would be: first, update the project's JDK and rebuild it targeting the new bytecode's version. There's a chance you'll have to upgrade both Ant and (if that's your IDE of choice) Eclipse (see here why).

其次,您必须检查编译错误,这很可能会导致您有条件地更新库以修复它们。解决了这些问题后,您必须运行您的应用程序并查看它是否按预期运行;请记住,当主题是依赖关系时,编译问题只是冰山一角。

Second, you'll have to check for compilation errors, which will most likely lead you to update libraries conditionally to get them fixed. With those solved, you MUST run your app and see if it's running as intended; remember that compilation problems are just the top of the iceberg when the subject are dependencies.

仔细检查应用程序的日志,查找任何类型的异常,但主要是与类相关的异常加载异常,如ClassCastException,ClassNotFoundException,NoClassDefFoundException,UnsatisfiedLinkError等。如果有任何问题,您必须逐个查明并搜索特定故障排除程序库的特定解决方案。

Carefully check the app's logs looking for exceptions of any kind but mainly the ones related to class loading exceptions such as ClassCastException, ClassNotFoundException, NoClassDefFoundException, UnsatisfiedLinkError and others. If any apear, you'll have to pinpoint one by one and search for the specific solution of the specific troublemaker library.

有了所有内容,您应该拥有自己的应用程序再次健康地运行。

With all that covered, you should have your app running healthily again.

最后一个提示,如果您的这个项目仍在开发中,那么将您使用的工具更新到他们的非常好的做法是一个非常好的做法。上次发布。还要更新开发工具,例如构建(例如Ant,Maven,Gradle等),JDK和IDE。在发布时更容易升级碎片而不是处理大规模升级:)

One last hint, if this project of yours is still being developed, it would be a very good practice to keep the tools you use updated to their very last release. Keep also the development tools updated, like build (such as Ant, Maven, Gradle and others), JDK's and IDE's. It way easier to upgrade the pieces as they are release than to handle a mass scale upgrade :)

这篇关于将现有Java Project从Java 1.6升级到1.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆