Unsupported major.minor version 51.0

I have report with ejbql datasource wich entity was build under jdk 1.7, so during preview I have following error "Unsupported major.minor version 51.0". I have same error then I run this report  in iReport but I change jdkhome param in ireport.conf and all build successfully. What config I need change in JasperSoft Studio (setup like sepparate eclipse plugin) for building my report(all eclipse enviroment set for jdk 1.7)

 

raggamuffin.inda.shell's picture
Joined: Oct 23 2012 - 5:37am
Last seen: 10 years 3 months ago

2 Answers:

Your preview is using an older version of Java. the '51' maps to 1.7.  This is why it works in eclipse, its using Java 1.7.

major version number of the class file format being used.
J2SE 7 = 51 (0x33 hex),
J2SE 6.0 = 50 (0x32 hex),
J2SE 5.0 = 49 (0x31 hex),
JDK 1.4 = 48 (0x30 hex),
JDK 1.3 = 47 (0x2F hex),
JDK 1.2 = 46 (0x2E hex),
JDK 1.1 = 45 (0x2D hex).

Reference:

 

djohnson53's picture
162734
Joined: May 25 2012 - 11:10am
Last seen: 1 year 1 month ago
yes I understand this, but I dont know which config file (or property?) and more over where this file what I need to change for right showing preview
raggamuffin.inda.shell - 10 years 5 months ago

Hi,
first of all can you better explain what you mean with "JasperSoft Studio (setup like sepparate eclipse plugin)"? 
This means you are using the standalone version, right? If yes which version?
To have a better idea of your system config, please answer the questions below:

  • how many java installation do you have in your system
  • which output do you get from command line: java -version

Please also check what is the JRE/JDK actually configured in JSS.

If you are using Jaspersoft Studio standalone you will not probably see "Installed JREs" item. You need to enable the Java capabilities: some stuff is actually hidden for non-technical users. To enable them do like this:

Another important thing. Is it possible that the jar (I suppose your entities are in there) you have was produced with a jdk7update5 and now in your system you have a jdk7update3? In other words the major version is the same, but minor one is not. 

Best regards,
Massimo

mrabbi's picture
23724
Joined: Oct 31 2011 - 9:20am
Last seen: 1 week 5 days ago
1. I have two java envoirment instaled 1.6 and 1.7 2. my default java version is 1.7: Java -version java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode) jaspersoft studio instaled like plugin in my eclipse indigo, not like a standalone application, its version is 1.3.1 in the eclipse i have only one jre instaled 1.7 seems that this plugin have default property for java version
raggamuffin.inda.shell - 10 years 5 months ago
Can you please check also the "JDK Compliance" section under Preferences>Java>Compiler. You should have something like "Compiler Compliance Level" = 1.7 and "Use default compliance settings". This at workspace level, but double check also at project level (properties). Moreover regarding "[...] ejbql datasource wich entity was build under jdk 1.7 [..]"... is this included as jar? Isn't possible that who packaged it was using a higher version of 1.7... for example 1.7 update 9 (the latest available)? Maybe try to upgrade your 1.7 installation to the latest update and see if it fixes the problem.
mrabbi - 10 years 5 months ago
Feedback