5 Replies Latest reply on Jun 15, 2010 10:27 PM by Luke McLean

    HornetQ and Java5...

    Tom Fennelly Master

      Hi guys... I just tried running v2.1.0.FINAL standalone using Java 5 and I get an UnsupportedClassVersionError (Bad version number in .class file).  Is that to be expected?  The docs say it should run on Java5.

        • 1. Re: HornetQ and Java5...
          Tim Fox Master

          Yes, 2.1 is Java 6+ only.


          Can you point me to the place in the docs where it says Java 5? I guess we forgot to update one

          • 2. Re: HornetQ and Java5...
            Tom Fennelly Master

            Duh... my bad... the FAQ says 2.0 will run on Java 5, but then does say 2.1 requires Java6.  Sorry guys!!

            • 3. Re: HornetQ and Java5...
              Luke McLean Newbie

              Hello Tim,


              Thank you for the 2.1.0 release. It was just in the nick of time and we have squeezed it into production to resolve the large message bugs. It appears to be working well. We do have an issue though. I realise that 2.1 server now requires Java 6, but it appears that the client also depend on the same 6 version. This is an issue for us (and I am guessing a number of other organisations) where there are a number of legacy systems which are not certified for java 6. I'd like to use HornetQ as our enterprise JMS however the rework for testing and upgrading to an unsupported version of Java makes this non trivial (impossible).


              Do you have any suggestions for 2.1.0 clients running on Java 5? (before I waste my time) Can you advise whether we can recompile the client jars on 5 or are there real dependecies on 6 in there?


              Thank you for your time,


              • 4. Re: HornetQ and Java5...
                Clebert Suconic Master

                The only class that requires Java6 at the moment is /work/projects/trunk/src/main/org/hornetq/utils/concurrent/HornetQConcurrentLinkedQueue.java.



                Maybe it would be possible to change the target on compilation to 1.5, and the clients would be compatible with Java 1.5.


                If that doesn't work, it would be possible to compile only the client part as java 1.5. Maybe provide a build.xml for java 5 classes.


                If you do something around that, it would be nice to have a patch. Maybe you could raise an issue.. attach a patch. It's probably something simple.

                • 5. Re: HornetQ and Java5...
                  Luke McLean Newbie

                  Thank you for your key information Clebert! Saved me some time.


                  I downloaded the src.zip, changed the first two lines in 'build-hornetq.properties to the following:





                  I just recompiled (build.bat) (it did so without any significant errors).


                  I was then able to use the following jars from <project>/build/jars on the client side (Java 5)





                  Well whadayaknow, it works beautifully.


                  Thank you,