aspose file tools*
The moose likes JBoss/WildFly and the fly likes java.lang.UnsupportedClassVersionError while running standalone.bat of jboss-as-7.1.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "java.lang.UnsupportedClassVersionError while running standalone.bat of jboss-as-7.1.1" Watch "java.lang.UnsupportedClassVersionError while running standalone.bat of jboss-as-7.1.1" New topic
Author

java.lang.UnsupportedClassVersionError while running standalone.bat of jboss-as-7.1.1

Siitesh Hind
Ranch Hand

Joined: Sep 06, 2012
Posts: 51
Hello,

I am getting the following error while trying to run the standalone.bat of jboss-as-7.1.1.

The java class could not be loaded. java.lang.UnsupportedClassVersionError: (org/jboss/modules/Main) bad major version at offset=6

JBoss 5.1.0 GA works just fine on the same Windows box.

Could anyone tell me how to resolve the same?

Rgds,

Seetesh
Siitesh Hind
Ranch Hand

Joined: Sep 06, 2012
Posts: 51
JVM is JRE 1.6

java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
Siitesh Hind
Ranch Hand

Joined: Sep 06, 2012
Posts: 51
Found the issue in the standalone.bat file not being configured as required.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

That exception means that the JVM used to run the app is older that the JVM version in the class files. For example, trying to run classes compiled with JDK 6 with JVM 5. I suspect that you were not using the version of JVM that you thought.

By the way, it would have been better if you specified exactly what you did wrong in standalone.bat and exactly what you did to fix it - your last post is too vague to provide help to anyone else who has the same issue and comes across this discussion.


JBoss In Action
Siitesh Hind
Ranch Hand

Joined: Sep 06, 2012
Posts: 51
Thanks Peter for one of the posts you had recommended earlier on not setting the JAVA_HOME in the JBoss configuration file which I had overlooked in standalone.bat. I removed the extra JAVA_HOME & JAVA setting in the standalone.bat. I reverted to the original setting.

if "x%JAVA_HOME%" == "x" (
set JAVA=java
echo JAVA_HOME is not set. Unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
) else (
set "JAVA=%JAVA_HOME%\bin\java"
)

BTW I dont have JRE or JDK 1.5 installed on the machine
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

Siitesh Hind wrote:BTW I dont have JRE or JDK 1.5 installed on the machine

Are you sure? You'd be surprised at the versions of Java that get installed by various applications, even by applications that you think have no relationship to Java.
Siitesh Hind
Ranch Hand

Joined: Sep 06, 2012
Posts: 51
What I meant was I dont have JDK 1.5 or JRE 1.5 installed.

But I have installed JRE 1.6 Update 22 on the machine which is default installed by the IS team.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.UnsupportedClassVersionError while running standalone.bat of jboss-as-7.1.1