Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem executing jar

 
Debopam Poddar
Ranch Hand
Posts: 51
Eclipse IDE Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have generated jar file from my simple java application.While executing I get following error.I'm using WSAD 5.1 and iText 2.0.8

My Manifest.mf contains following entry:
Manifest-Version: 1.0
Main-Class: com.raj.GenerateWordReport
Class-Path: iText-2.0.8.jar db2java.zip


Error log while executing this.
C:\DAILY REPORT>java -jar GenerateReport.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/raj/GenerateWordReport (Unsupported major.minor version 48.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
 
Amir Pourteymour
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JDK version that you used to code and the one you're using to run are different. That's why you should use the same version or use this command while compiling.

javac -source version -target version NameOfClass.java
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic