我们如何更改 iReport 的 Java 平台版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12914674/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 10:46:12  来源:igfitidea点击:

How Can we change Java Platform version for iReport

javaireport

提问by Subodh Joshi

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

在我的 Widows 机器中,我安装了两个Java版本(1.5 和 1.6)。

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

我已经安装了iReport 4.0.7,但它默认采用Java1.5 版,当我运行它时,它抛出异常。

A java.lang.UnsupportedClassVersionError exception has occurred.

发生了 java.lang.UnsupportedClassVersionError 异常。

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

谁能告诉我如何告诉iReportJava 1.6而不是 1.5上运行。

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

我已经从环境变量中删除了Java 1.5 的Path和其他条目。

enter image description here

enter image description here

回答by Kent

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.

正如我在评论中所说。如果您使用 jasper api 在容器(例如 tomcat/jboss/...)中运行您的应用程序,您必须检查您的容器配置,以确保 java_home 指向正确的 Java 版本。

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

如果您的问题是关于 ireport。你可以检查你的{YourireportPath}/etc/ireport.conf那里你可以找到一行:

# 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.

取消注释并使其正确。它可能会解决您的问题。抱歉,不知道 Windows 安装程序等高级功能。

回答by user5821357

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

17253:与 JasperServer 安装程序捆绑在一起的 iReport 3.7.1 需要特殊处理才能与 Vista 或 Windows 7 一起运行。在这些操作系统平台上,iReport 必须使用最新版本的 Java 1.6 或当前版本的Java 1.7 测试版。在这些操作系统平台上,iReport 将需要大于或等于:1.6.0_18-b03 或 1.7.0-b74 的 JDK。此外,您将需要修改 iReport 加载程序脚本以指向此更高的 Java 版本。编辑以下文件 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.`

更改这一行:SET JAVADIR=%CD%\java 到这一行:SET JAVADIR=\java 例如:SET JAVADIR=C:\Program Files\Java\jdk1.7.`

回答by Sai

This is for Ireport-2.0.1

这是用于 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.batfile (C:\Program Files (x86)\Jaspersoft\iReport-2.0.1)

通过启动iReport.bat文件关闭并重新启动 iReport ( C:\Program Files (x86)\Jaspersoft\iReport-2.0.1)