Am 02.10.2012 um 21:23 schrieb doug andrews <dandr...@mediaspansoftware.com>:

> Is it possible to deploy an application compiled with java 6 on a machine 
> running java 1.4?
> I have both Java 6 and 4 on my machine.
> I have a test application created using the Eclipse ant build while running 
> java 6.
> I force the app to use java 1.4 when deployed by modifying the MacOS class 
> path file:
> 
> # JVM  == 
> /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2_22/Commands/java
> 
> When I run, I get this error:
> java.lang.UnsupportedClassVersionError: 
> com/webobjects/appserver/WOApplication (Unsupported major.minor version 49.0)
> 
> My java 6 version is:
> java version "1.6.0_29"
> Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11E53)
> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
> 
> My java 4 version is:
> java version "1.4.2_22"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_22-b02-329)
> Java HotSpot(TM) Client VM (build 1.4.2-92, mixed mode)
> 
> I've tried modifying the build.xml "wocomplile" argument like this:
> <wocompile srcdir="Sources" target="1.4" source="1.4" destdir="bin" 
> fork="yes" memoryMaximumSize="256m" debug="yes">
> but this does not seem to work.
> 
> I'm pretty sure this is possible, but cannot figure out how.

No, it's not. There have been class file format modifications, especially from 
5 to 6, and Java generally doesn't guarantee downward compatibility with new 
releases[1]. You can't load those class files on a 1.4 JVM. You have to compile 
with JDK 1.4 to do that, and if you have generics *anywhere*, you can't do that 
either.

I suggest you get rid of that 1.4 installation.

Maik

[1] http://www.oracle.com/technetwork/java/javase/compatibility-137541.html


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to