views:

22

answers:

2

Hi All,

I have two machines with difference JVM versions (1.6 and 1.5)

I have a JBOSS Server running on the one of JDK1.5. I've created a ejb jar file on the machine of JDK1.6

When I get to deploy the EJB Jar into the JBOSS(4.3), I get the following error:

16:05:41,878 WARN  [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=ejb1_test.jar
java.lang.ClassNotFoundException: Unexpected error during load of: org.daz.TimeServiceBean, msg=Bad version number in .class file
+1  A: 

If you want to run in java 1.5 then you should compile in java 1.5 or lower.

Alternatively, if you simply must run JDK 6 then as @Paul Tomblin suggests you can use the -target javac option. One warning on this though, if you are using any of the new Java 1.6 API features javac 1.6 (e.g. setting File perms) javac will not complain but you will get errors when running this code in java 1.5.

krock
A: 

javac has a -target option that allows you to compile to a 1.5 jvm with a 1.6 compiler. See javac -help for details.

Paul Tomblin
Yes, I used it. Thanks.
Mohammed