当我在 Sco OpenServer 5.0.6 版上运行 java 应用程序时遇到问题
我的 Sco OpenServer Release 5.0.6 有一个 java 版本:
# java -version
java version "1.3.1_22"
Java(Tm) Runtime Environment, Standard Edition (build SCO-UNIX-J2SE-1.3 .1_22:* FCS*:20080305) 经典VM(构建SCO-UNIX-J2SE-1.3.1_22:FCS:20080305,绿色线程,sunwjit)
我的java应用程序是在Windows中使用java版本6更新25开发的 我明白,
我应该更改我的代码以使用 java 1.3,如下所示:
- 不支持 Generic
ArrayList
(String,double) 不支持 String.format
- 不支持 For every 循环
应该用什么代码来替换下面不支持的java版本代码?
ArrayList<String> messages;
for (String message : messages)
String.format("%1$td/%1$tm/%1$tY %1$tI:%1$tM:%1$tS %1$Tp", new Date())
My Sco OpenServer Release 5.0.6 have a java version which is :
# java -version
java version "1.3.1_22"
Java(Tm) Runtime Environment, Standard Edition (build SCO-UNIX-J2SE-1.3.1_22:*
FCS*:20080305)
Classic VM (build SCO-UNIX-J2SE-1.3.1_22:FCS:20080305, green threads, sunwjit)
My java application have developed in Windows with java version 6 update 25.
i understand , i should change my code to work with java 1.3 like following trouble :
- Generic is not supported like
ArrayList<String>
- String.format is not supported for
(String,double)
- For each loop is not supported
What code should come to replace the unsupported java version code below?
ArrayList<String> messages;
for (String message : messages)
String.format("%1$td/%1$tm/%1$tY %1$tI:%1$tM:%1$tS %1$Tp", new Date())
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的服务器上的 Java 版本无法升级吗? 1.3 已经很古老了,我认为你最终会遇到麻烦。但要回答您的具体问题:
Is there no possibility to upgrade the version of Java on your server? 1.3 is pretty ancient and I think you'll end up with trouble. But to answer your specific questions: