WAS 6.1 显示 Java 版本 5,但实际上是 1.4
我有一个奇怪的问题。
我已将 Websphere Application Server 配置为运行 Java 5。它是我从 Java 4 迁移而来的非常旧的应用程序。
如果我在 jsp 页面中打印,
System.getProperty("java.version")
System.getProperty("java.specification.version")
System.getProperty("java.vm.name")
我会得到
Java 版本:1.5.0
java.规格.版本:1.5
java.vm.name: IBM J9 VM
但是,如果我在 jsp 中将代码从 List
更改为 List
ArrayList 类型不是泛型;它不能用参数
怎么会这样???
I have a strange problem.
I have configured our Websphere Application Server to run Java 5. Its a really old application that I have migrated from Java 4.
If I in the jsp page print
System.getProperty("java.version")
System.getProperty("java.specification.version")
System.getProperty("java.vm.name")
I get
Java version: 1.5.0
java.specification.version: 1.5
java.vm.name: IBM J9 VM
However, If I in the jsp change the code from List
to List<Object>
I get the following exception:
The type ArrayList is not generic; it cannot be parameterized with arguments <Object>
JSPG0091E: An error occurred at line: 79 in the file: /jsp/archive/archiveoverview.jsp
JSPG0093E: Generated servlet error from file: /jsp/archive/archiveoverview.jsp
C:\SDP75\runtimes\base_v61\profiles\was61profile1\temp\CR122599Node01\server1\myifEAR\myif.war\jsp\archive\_archiveoverview.java : 199 : Syntax error, parameterized types are only available if source level is 5.0
How can this be???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
用于运行 WebSphere Application Server 的 JVM 与用于编译服务器内运行的 JSP 的编译器合规级别不同。请参阅此技术说明:在面向 WebSphere Application Server v6 的 JSP 中使用 Java 5 语言功能.1。
The JVM used to run WebSphere Application Server is different from the compiler compliance level used to compile JSPs running within the server. See this technote: Using Java 5 language feature in a JSP targeting WebSphere Application Server v6.1.