I got this error deploying a JSP that has a for:each loop in it to the WebSphere 6.1 test environment using IRAD.
Syntax error, 'for each' statements are only available if source level is 5.0
The JSP compiles fine in the development environment, so I'm guessing it's a WebSphere 6.1 Applicatoin Server problem, not an IRAD issue, even if it is the test environment.
I googled and got a few suggestions to change the Compiler Preferences of the Java project to 5.0, but I've done that. It seems to apply to the project inside of IRAD, but not the deployed server environment. How do I cange the WebSphere Server to recognize the 5.0 syntax features.
Darn thing works just fine on Tomcat 5.5 installed on the same machine. Sheesh. IBM - making easy things difficult! I'm sure this will all be fixed when WebSphere 7 comes out.
Jeanna, I'm so ashamed that you've taken me for someone asking how to yank out one JVM and replace it with another on a given WebSphere Application Server.
My curiosity was the fact that it was my understanding that WebSphere 6.1 DID run Java 1.5. I mean, wasn't that the whole idea of coming out with WebSphere 6.1? To hep bridge between 6.0, and WebSphere 7.0, which will likely never actually be released?
Here are the system requirements for the WebSphere Application Server 6.1, which I found here:
Java� The WebSphere-supplied Java 2 SDK is required for both the run time and any remote Java clients
* (+) IBM 32-bit SDK for Windows, Java 2 Technology Edition, V5.0 SR2 - that means JVM 1.5, right?
Of course, I have IRAD 7 installed, and I am using the WebSphere 6.1 runtime environment, as the WebSphere 7.0 runtime environment wasn't an installation options . When I start up my server, here's the output I get, indicating that indeed, the server is using Java 5:
************ Start Display Current Environment ************ WebSphere Platform 6.1 [BASE 184.108.40.206 cf20633.22] running with process name Node01Cell\Node01\server1 and process id 3340 Host Operating System is Windows XP, version 5.1 build 2600 Service Pack 2 Java version = J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 j9vmwi3223-20060504 (JIT enabled) J9VM - 20060501_06428_lHdSMR JIT - 20060428_1800_r8 GC - 20060501_AA, Java Compiler = j9jit23, Java VM name = IBM J9 VM was.install.root = D:\Program Files\IBM\SDP70\runtimes\base_v61 user.install.root = D:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrv01 Java Home = D:\Program Files\IBM\SDP70\runtimes\base_v61\java\jre Java Library path = D:\Program Files\IBM\SDP70\runtimes\base_v61\java\jre\bin;
See, it looks an awful lot like I'm actually using a 1.5 JVM for my runtime, wouldn't you think?
So, still, when I deploy my JSPs that have a for:each loop in them, I get this crazy error that says Syntax error, 'for each' statements are only available if source level is 5.0? And what does that mean anyways?
What is a source level? That's not the JVM level? The compiler level (as it's in a JSP, which must be compiled). Did I not use a JSP editor that was up to the standards of the deployment environment? Seriously, what the heck are they talking about when they talk about the source level?
So, I'm really thinking that maybe a WAR file or an EAR file, or even worse, an IBM extension file, states a certain version to use, and somehow cripples the JVM if it's actually running at a higher version.
Anyways, there's alot to digest here. More than anything, I'm trying to rant out my thoughts and make sure I'm not thinking crazy like.
[ November 26, 2007: Message edited by: Cameron McKenzie ] [ November 26, 2007: Message edited by: Cameron McKenzie ]
Well, there's a few things I'm doing that are quite interesting, and they might be helping me through some of my problems.
In IRAD, you can set a JDK compliance level, up to Java 6! Man, does that ever stir the pot. So, before creating any war files in RSA, I'm setting the complicance level to 1.5
Windows --> Preferences
+Java ++Compiler Compiler Compliance Level: 5.0
Then, when I create a J2EE project, or more specifically, a web project, I edit the project facets at creation time. The change doesn't seem to apply if you make the change after you have created the project. But in Project Facets, where you can add things like Faces or Struts support, you can set the Java level. The default is 1.4, but if you click on the number, a hidden drop down box appears that allows you to set it to 1.3 or 1.5. I set mine to 1.5.
From there, it seems some of my troubles have disappeared. I haven't made any changes to the server configuration in RSA/IRAD, but the code seems to compile.