简体   繁体   English

将我们的应用程序从 java 版本 6 转换为版本 5,

[英]Convert our app from java version 6 to 5,

Is there any solution through which I can convert java'a higher application, created in.netbeans IDE 6.5.1, into lower version of java version 5.有什么解决方案可以将在.netbeans IDE 6.5.1 中创建的 java 更高版本转换为 java 版本 5 的较低版本。

If you have the source code, which I assume you do, this might be easy or difficult depending on the code.如果您有源代码(我假设您有),这可能容易也可能困难,具体取决于代码。

Java 6 made few language changes over Java 5. The only one that springs to mind is you can put @Override on implementations of an interface. Java 6 相对于 Java 5 做了一些语言更改。唯一想到的是您可以将 @Override 放在接口的实现上。

The bigger issue is whether you use any of the API differences, of which there are several.更大的问题是您是否使用 API 差异中的任何一个,其中有几个。 I think JDBC has some major differences, which you may or may not use.我认为 JDBC 有一些主要差异,您可能会使用也可能不会。

These issues may be big or small.这些问题或大或小。 It's really hard to say without knowing anything about your app.在不了解您的应用程序的情况下真的很难说。 Generally speaking though they should be small.一般来说,虽然它们应该很小。

Otherwise you should mostly just be able to recompile it with a Java 5 compiler.否则,您应该只能使用 Java 5 编译器重新编译它。

If you don't have the source code it's still doable but you just need to disassemble it first and fixing any issues may be tedious.如果您没有源代码,它仍然可行,但您只需要先反汇编它,修复任何问题可能会很乏味。

You can simply try to recompile it for Java 5. As no language-changes are made between version 5 and 6 you can only run into problems, if you use APIs added or enhanced with the version-upgrade.您可以简单地尝试为 Java 重新编译它 5. 由于版本 5 和 6 之间没有语言更改,如果您使用通过版本升级添加或增强的 API,您只会遇到问题。

If you have the source, you could use backported libraries and code rewrite.如果您有源代码,则可以使用向后移植的库和代码重写。 There is a tool called Retroweaver which can convert 1.5 code to 1.4, but I doubt It works for 6 to 5.有一个名为 Retroweaver 的工具可以将 1.5 代码转换为 1.4,但我怀疑它是否适用于 6 到 5。

there is an option somewhere to tell Netbeans to generate GUI with non-Java 6 classes.某处有一个选项可以告诉 Netbeans 使用非 Java 6 类生成 GUI。 It is documented somewhere, sorry I don't remember.它记录在某处,抱歉我不记得了。 I've already switched to Netbeans 6.7 (RC3).我已经切换到 Netbeans 6.7 (RC3)。

Check also usages of Desktop API, @Override in implementing interface methods, etc.还要检查 Desktop API、@Override 在实现接口方法等方面的用法。

It is a good practice to build with a JDK5 in a CI server (like hudson).在 CI 服务器(如 hudson)中使用 JDK5 进行构建是一种很好的做法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在我们的Java应用程序中从Word粘贴时出现奇怪的字符 - Strange characters when pasted from Word in our Java app 使用序列化将对象传递给另一个JVM - 相同的Java版本和jar(都运行我们的应用程序) - pass object to another JVM using serialization - same Java version and jars (both running our app) 从我们的Java程序执行Java程序 - Execute a Java program from our Java program 如何在我们的 java jars 中插入用户可以访问的版本号? - How to insert version numbers in our java jars, that a user can access? 我们的Java程序的外部程序 - External program from our Java program 如何使用JAVA Eclipse从APK文件获取应用版本 - How to get app version from apk file using JAVA eclipse 为什么我们的Java应用程序不在辅助监视器上显示窗口? - Why would our Java app not display windows on secondary monitor? 在 android 中从我们的应用更改另一个应用的权限 - Change permission of another app from our app in android 为什么我们的MobileFirst Java适配器收到不匹配的Java版本消息? - Why do we get a mismatching Java version message for our MobileFirst Java adapters? “mvn -version”中的 java 版本与 mac 的“java -version”中的版本不同 - The java version in “mvn -version” is different from the version in “java -version” for mac
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM