Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGL Development Tools » How to Configure back level Java version(What Workbench settings allow compiling to a backlevel Java version?)
How to Configure back level Java version [message #904600] Tue, 28 August 2012 15:48 Go to next message
Jeffrey Gardner is currently offline Jeffrey Gardner
Messages: 20
Registered: August 2012
Junior Member
Question
How do I configure the EGL workbench to allow a project to run a a lower level java release? Can you point me to documentation?

Background
I am working on the sample "Hello World" EGL Tutorial. My PC has Java 1.6 installed.

The Default workbench settings produce a project that runs correctly in the workbench server and in a Tomcat 6.0 server running on my PC. It however does not run on the Tomcat server 6.0 running on my IBM iSeries V5R4 machine with JDK1.5


EGL Workbench global preferences:
- "Java/Compiler/Compiler compliance level" shows 1.6
- "Java/Installed JREs" shows jre6 and it is checked as the default
- I have also added jre1.5.0_11 to the list

iSeries settings:
- OS/400 V5R4
- JDK 1.5
- Tomcat 6.0.20
- JAVA_HOME=/qibm/proddata/java400/jdk15 (ths is set in the Tomcat setclasspath.sh)

To attempt to compile this project under Java 1`.5 I set the following in the project preferences:

EGL Project settings:
- Compiler compliance level - 1.5
- I set this in the code Project
- I also had to set it in the Deployed project since when the EGL Descriptor was deployed, the new project had the default settings, i.e. 1.6.

- Installed JREs
- jrel1.5.0_11
- jre6 << This one is normally checked as the default included one
- Execution environments
- JS2E-1.5 = jrel1.5.0_11
- JavaSE-1.6 = jre6
- Java Build Path lists the JRE System Library [jre1.5.0_11 ]



I cannot seem to make this run correctly even in the workbench server.

Are there other settings that I am missing here?

[Updated on: Tue, 28 August 2012 15:49]

Report message to a moderator

Re: How to Configure back level Java version [message #905135 is a reply to message #904600] Wed, 29 August 2012 15:11 Go to previous messageGo to next message
Dan Darnell is currently offline Dan Darnell
Messages: 145
Registered: November 2011
Location: Arkansas
Senior Member
Set your compliance level as shown in the attached screen shot. You'll do this on the deployed project -- not the EGL project.

There is no need to install a back-level JDK/JRE. You are just using a feature of the 1.6 compiler to compile to a back-level.

This technique worked for me until I recently brought the IBM i server up to 1.6. I'm not sure that everything generated out of EDT is still 1.5 compatible (or, if it is, will it be next week or next month?). It would be a good idea to get your IBM i runtime up to 1.6.

--Dan

index.php/fa/11322/0/
  • Attachment: jcompiler.png
    (Size: 52.14KB, Downloaded 399 times)

[Updated on: Wed, 29 August 2012 15:11]

Report message to a moderator

Re: How to Configure back level Java version [message #905610 is a reply to message #905135] Thu, 30 August 2012 14:31 Go to previous messageGo to next message
Jeffrey Gardner is currently offline Jeffrey Gardner
Messages: 20
Registered: August 2012
Junior Member
Thanks. I didn't understand the *PRV ability of the Java compiler. I managed to get this set up and exported using the 1.5 export settings you recommended.

Results:
It ran correctly on my PC under a Tomcat 6.0.20 running Java 1.6. (It will run both the 1.5 and the 1.6 exported war file).

It would not deploy on my PC when Tomcat was using Java 1.5, giving error message "java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class org.eclipse.edt.javart.util.gzip.CompressionFilter)..."

It still would not deploy to Tomcat 6.0.20 on the iSeries running Java 1.5, giving me a log message of "java.lang.UnsupportedClassVersionError: org/eclipse/edt/javart/util/gzip/CompressionFilter (unable to load class org.eclipse.edt.javart.util.gzip.CompressionFilter)..."

This is the same message I got when I tried to deploy the war generated for Java 1.6 (which is why I thought generating a backlevel Java version would solve it.)

The next step was Java 1.6 on the iSeries -- I had thought of that too.

I installed Java 1.6, but could not get Tomcat even started trying both /qibm/proddata/java400/jdk6 and /QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit as my JAVA_HOME. I therefore installed the latest Group and Cume for 5722JV1 to get 1.6 up to current fix level.

This morning, Tomcat starts on the iSeries under Java 1.6 and will correctly run both the 1.6 and the 1.5 exported war files.

It does seem like using a *PRV compile isn't a complete solution as you alluded to.

Thanks for the help.
Re: How to Configure back level Java version [message #905630 is a reply to message #905610] Thu, 30 August 2012 15:23 Go to previous messageGo to next message
Matt Heitz is currently offline Matt Heitz
Messages: 36
Registered: July 2009
Member
Jeffrey,

You got the UnsupportedClassVersionError because the EDT Java Runtime is compiled with Java 1.6. Your upgrade to 1.6 was the right solution.

Our Supported Platforms wiki page says that you need Java 1.6 or 7.

-Matt

Re: How to Configure back level Java version [message #905990 is a reply to message #905630] Fri, 31 August 2012 08:26 Go to previous message
Jeffrey Gardner is currently offline Jeffrey Gardner
Messages: 20
Registered: August 2012
Junior Member
Thanks, Matt, for the link to the additional info. I'm new to this and haven't had time to make it around to see everything yet. I'm now trying to make time to work through the tutorials (now that I can actually run the examples on my iSeries!)
Previous Topic:Support for date and time operations?
Next Topic:View - ActionView
Goto Forum:
  


Current Time: Thu Aug 21 22:12:21 EDT 2014

Powered by FUDForum. Page generated in 0.14248 seconds