File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes only available if source level is 5.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "only available if source level is 5.0" Watch "only available if source level is 5.0" New topic
Author

only available if source level is 5.0

Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

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.

-Cameron
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

Originally posted by Cameron McKenzie:
How do I change the WebSphere Server to recognize the 5.0 syntax features.

You don't. As far as I know, there isn't any supported way of changing the server version of Java.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

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:

WebSphere Application Server 6.1 System Requirments - Java Runtime JVM Version

And it states:


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

SOURCE LEVEL?


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.

-Cameron

[ November 26, 2007: Message edited by: Cameron McKenzie ]
[ November 26, 2007: Message edited by: Cameron McKenzie ]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

Cameron,
You actually knew more than me on this front. I hadn't realized 6.1 supported Java 5.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

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.

I will continue to test and see.

Happy WebSphere!

-Cameron McKenzie
exlakro
Greenhorn

Joined: Dec 13, 2007
Posts: 1
According IBM's documentation, the JSP's engine in
was 6.1 works with java 1.5 if you setting the
parameter jdkSourceLevel to 15 in the file: Web-INF/ibm-Web-ext.xmi

All the details in:

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/rweb_jspengine.html
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tweb_jspengine.html

I hope that this information was enougth.

Quito - Ecuador
jeroen dijkmeijer
Ranch Hand

Joined: Sep 26, 2003
Posts: 131
To hep bridge between 6.0, and WebSphere 7.0, which will likely never actually be released?

That's actually good news never any WS upgrade projects anymore! Are you sure?
jeroen dijkmeijer
Ranch Hand

Joined: Sep 26, 2003
Posts: 131
To hep bridge between 6.0, and WebSphere 7.0, which will likely never actually be released?

That's actually good news never any WS upgrade projects anymore! Are you sure?
 
wood burning stoves
 
subject: only available if source level is 5.0
 
Similar Threads
Testing Applications in Websphere Studio Enterprise Developer
JSP Expression Compilation Problem.
datearray
iRAD 7 - WAS 6.1 - jdk 1.4.2 compatibility
RAD 6.0 vs. RAD 7.0 performance comparison