2

In my Widows Machine i have two Java version Installed (1.5 and 1.6).

I've installed iReport 4.0.7, but it is by default taking Java version 1.5 and when I am running it, it is throwing exception.

A java.lang.UnsupportedClassVersionError exception has occurred.

Can anyone tell me how can I tell iReport to run on Java 1.6 rather than 1.5.

I've already deleted Path and other entry for Java 1.5 from environment variables.

enter image description here

Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
  • 2
    you run jasper in a container or standalone? please check your JAVA_HOME var. make sure it is pointing to the right java version. – Kent Oct 16 '12 at 12:30
  • 2
    My JAVA_HOME=C:\Program Files\Java\jdk1.6.0_34; and i installed iReport-4.7.0-windows-installer and in installation time i got same exception A java.lang.UnsupportedClassVersionError exception has occurred.and When i am typing java -version in command prompt i am getting right version – Subodh Joshi Oct 16 '12 at 12:35
  • @subodh Are you talking about using *iReport* or about writing Java application with *JR API*? – Alex K Oct 16 '12 at 12:39

3 Answers3

6

as I said in comment. if you run your application in a container (say tomcat/jboss/...) with jasper api, you have to check your container conf, to make sure java_home is pointing to right java version.

If your question is about ireport. you could check your {YourireportPath}/etc/ireport.conf there you could find one line:

# default location of JDK/JRE, can be overridden by using --jdkhome <dir> switch
#jdkhome="/path/to/jdk"

uncomment it and make it right. it may solve your problem. Sorry no idea about those advanced features like windows installer.

Kent
  • 189,393
  • 32
  • 233
  • 301
  • @subodh See more details in [Where can I set the JRE/JDK which is used to run Netbeans besides the command line?](http://stackoverflow.com/questions/504087/where-can-i-set-the-jre-jdk-which-is-used-to-run-netbeans-besides-the-command-li) post. – Alex K Oct 16 '12 at 13:19
1

17253: iReport 3.7.1, which is bundled with the JasperServer installer, needs special handling in order to run with Vista or Windows 7. On these OS platforms, iReport must run with the most current versions of Java 1.6 or the current version of the Java 1.7 beta. On these OS platforms, iReport will require JDKs greater or equal to: 1.6.0_18-b03 or 1.7.0-b74. Additionally, you will need to modify the iReport loader script to point to this higher Java version. Edit the following file f0`ile: \ireport\bin\iReportLoader.bat

Change this line: SET JAVADIR=%CD%\java To this line: SET JAVADIR=\java For example: SET JAVADIR=C:\Program Files\Java\jdk1.7.`

0

This is for Ireport-2.0.1

after update updating your Environment variables

JAVA_HOME=C:\Java\jdk1.5.0_22

Path=C:\Java\jdk1.5.0_22;

(added at the beginning)

Close and Restart iReport by launching the iReport.bat file (C:\Program Files (x86)\Jaspersoft\iReport-2.0.1)

Boiethios
  • 38,438
  • 19
  • 134
  • 183
Sai
  • 357
  • 1
  • 6
  • 17