Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Siitesh Hind
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found the issue in the standalone.bat file not being configured as required.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Siitesh Hind
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic