简体   繁体   中英

why won't jetty 6.1.x run with java 1.4.2?

Dcoumentation everywhere I can find suggests that jetty 6.1.x should still run with java 1.4.2.

Yet, if I download a jetty binary, and "java -jar start.jar", I get variations of:

"Exception in thread "main" java.lang.UnsupportedClassVersionError: (org/mortbay/xml/XmlConfiguration) bad major version at offset=6"

I've tried it with jetty 6.1.26 downloaded from dist.codehouse.org/jetty. I've tried with with the 'hightide' jetty release 6.1H.24 and hightide-6.1H.8.

My java is:

$ java -version java version "1.4.2" Java(TM) 2 Runtime Environment, Standard Edition (build 2.3) IBM J9 VM (build 2.3, J2RE 1.4.2 IBM J9 2.3 Linux amd64-64 j9vmxa64142ifx-20100113 (JIT enabled) J9VM - 20100112_51454_LHdSMr JIT - 20090210_1447ifx1_r8 GC - 200902_24)

I know this is anchient java here, but I've got some ancient code to run on it. Everywhere SAYS jetty 6.1 should run on java 1.4. I even find ancient blog posts saying they did run jetty 1.6 with java 1.4.

So what's up? What am I doing wrong?

As I see on http://docs.codehaus.org/display/JETTY/what+JVMs+are+supported the latest Jetty, that runs on JDK 1.4 is 6.1.5. So, you need to get old version of jetty.

Other way is to compile jetty from source by yourself. Tutorial how to do it is on Jetty wiki

Okay, I figured it out.

jetty 6.1.26 in particular, and all jetty 6.1.x in general, DO run on Java 1.4, and the.jars distributed on the official site ARE compiled to work with java 1.4.

So why wasn't it working for me?

Some of the sample webapps distributed with jetty do NOT work under 1.4, they are not compiled for 1.4. I don't know if this a packaging accident or what.

But if I delete all the sample apps, by deleting everything in./webapps and./contexts, then the stock distro binary jetty 6.1.26 release starts up fine under 1.4, and works fine when I install my own webapps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM