Shervin Asgari
Shervin Asgari

Reputation: 24499

WAS 6.1 shows Java version 5, but its really 1.4

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???

Upvotes: 3

Views: 3324

Answers (1)

Brett Kail
Brett Kail

Reputation: 33936

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.

Upvotes: 5

Related Questions