UnsupportedVersionError means that you compiled the Java source code with a newer version of Java than the one you are trying to run it with. Java is compatible with the lower version (newer versions of Java can run Java programs compiled with older versions), but are not compatible with the previous version (older versions of Java cannot run Java programs compiled with newer versions).
You say you use Java 5 on Unix. Did you compile it using Java 6 on Windows? Then it obviously won't work.
Possible solutions:
- Compile the source code using Java 5 on Windows (the safest option)
- Use compiler flags:
-source 1.5 -target 1.5 at compile time (this will not protect you from using Java 6 classes from the standard library only, so this is not a complete guarantee that your program will work without errors in Java 5) - Migrating to Java 6 on Unix
source share