Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB java.lang. UnsupportedClassVersionError (Unsupported major.minor version 48.0)  RSS feed

Amnesiac Uno
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to run my first EJB. Its been problems all the way right from deploying to running. I was able to get over the NamingException after searching these forums thoroughly.(thanks to Z Zia)

I am trying to RUN the Advice example from Head First EJB.
I am now getting a new Exception (
When I try to run my client code it throws this exception:

Exception in thread "main" java.lang.UnsupportedClassVersionError: javax/ejb/EJB Home (Unsupported major.minor version 48.0)

I am using J2sdk1.4.2_04 and Sun Java System Application Server Platform Edition 8.1.

All the classpath and path settings(including j2ee,jar) are correct.

a part of the code is:

Hashtable env = new Hashtable();
Context ic = new InitialContext(env);
Object o = ic.lookup("Advisor");
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);
Advice advisor = home.create();

Thanks a lot!
Dave Clark
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this error -> "Unsupported major.minor version 48.0"
simply means that you've compiled your classes with JDK 1.4, but you're trying to run them with an older JVM, problably JDK 1.3.

So it seems that the path fpor your client code must be pointing to a non-JDK 1.4 JVM

Try typing:

java -version

at a command prompt to verify your path points to a JDK 1.4 before any other VMs you may have installed,


Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!