在使用iReport Designer在jdk 7能够正常使用,最近升级到jdk8,发现打开就自动关闭了,检查log发现如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

-------------------------------------------------------------------------------
>Log Session: Wednesday, October 26, 2016 10:32:59 AM SGT
>System Info:
Product Version = Jaspersoft iReport Designer 5.6.0
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0_101; Java HotSpot(TM) 64-Bit Server VM 25.101-b13; Oracle Corporation
Runtime = Java(TM) SE Runtime Environment 1.8.0_101-b13
Java Home = D:\Java\jdk1.8.0_101\jre
System Locale; Encoding = en_SG (ireport); Cp1252
Home Directory = C:\Users\duliu
Current Directory = D:\Program Files\Jaspersoft\iReport-5.6.0
User Directory = C:\Users\duliu\.ireport\5.6.0
Installation = D:\Program Files\Jaspersoft\iReport-5.6.0\ireport
D:\Program Files\Jaspersoft\iReport-5.6.0\ide10
D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5
D:\Program Files\Jaspersoft\iReport-5.6.0\platform9
Boot & Ext. Classpath = D:\Java\jdk1.8.0_101\jre\lib\resources.jar;D:\Java\jdk1.8.0_101\jre\lib\rt.jar;D:\Java\jdk1.8.0_101\jre\lib\sunrsasign.jar;D:\Java\jdk1.8.0_101\jre\lib\jsse.jar;D:\Java\jdk1.8.0_101\jre\lib\jce.jar;D:\Java\jdk1.8.0_101\jre\lib\charsets.jar;D:\Java\jdk1.8.0_101\jre\lib\jfr.jar;D:\Java\jdk1.8.0_101\jre\classes;D:\Java\jdk1.8.0_101\jre\lib\ext\access-bridge-64.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\cldrdata.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\cryptix-jce-api_1.2.2.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\cryptix-jce-provider_1.2.2.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\cryptix-message-api_1.4.2.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\cryptix-openpgp-provider_1.4.2.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\cryptix-pki-api_1.4.2.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\dnsns.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\jaccess.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\jfxrt.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\localedata.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\nashorn.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\sunec.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\sunjce_provider.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\sunmscapi.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\sunpkcs11.jar;D:\Java\jdk1.8.0_101\jre\lib\ext\zipfs.jar
Application Classpath = D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\lib\boot.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\lib\org-openide-modules.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\lib\org-openide-util.jar;D:\Java\jdk1.8.0_101\lib\dt.jar;D:\Java\jdk1.8.0_101\lib\tools.jar
Startup Classpath = D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\core.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\org-openide-filesystems.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\core_de.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\core_es.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\core_fr.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\core_it.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\core_ja.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\core_pl.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\core_pt_BR.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\core_sq.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\core_zh_CN.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\core_zh_TW.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\org-openide-filesystems_de.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\org-openide-filesystems_es.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\org-openide-filesystems_fr.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\org-openide-filesystems_it.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\org-openide-filesystems_ja.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\org-openide-filesystems_pl.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\org-openide-filesystems_pt_BR.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\org-openide-filesystems_sq.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\org-openide-filesystems_zh_CN.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\platform9\core\locale\org-openide-filesystems_zh_TW.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\ireport\core\locale\core_ireport.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\core_nb_de.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\core_nb_es.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\core_nb_it.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\core_nb_ja.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\core_nb_pt_BR.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\core_nb_zh_CN.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\core_nb_zh_TW.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\org-netbeans-upgrader_de.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\org-netbeans-upgrader_es.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\org-netbeans-upgrader_it.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\org-netbeans-upgrader_ja.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\org-netbeans-upgrader_pt_BR.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\org-netbeans-upgrader_zh_CN.jar;D:\Program Files\Jaspersoft\iReport-5.6.0\nb6.5\core\locale\org-netbeans-upgrader_zh_TW.jar
-------------------------------------------------------------------------------
java.lang.IllegalStateException: java.lang.IllegalAccessException: Class org.openide.util.WeakListenerImpl$ProxyListener can not access a member of class org.openide.filesystems.$Proxy0 with modifiers "public"
at org.openide.util.WeakListenerImpl$ProxyListener.<init>(WeakListenerImpl.java:413)
at org.openide.util.WeakListenerImpl.create(WeakListenerImpl.java:154)
at org.openide.util.WeakListeners.create(WeakListeners.java:268)
at org.openide.filesystems.MultiFileObject.<init>(MultiFileObject.java:116)
at org.openide.filesystems.MultiFileObject.<init>(MultiFileObject.java:133)
at org.openide.filesystems.MultiFileSystem.getMultiRoot(MultiFileSystem.java:251)
at org.openide.filesystems.MultiFileSystem.getRoot(MultiFileSystem.java:236)
at org.netbeans.core.startup.ModuleSystem.<init>(ModuleSystem.java:112)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:155)
at org.netbeans.core.startup.Main.start(Main.java:312)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:110)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalAccessException: Class org.openide.util.WeakListenerImpl$ProxyListener can not access a member of class org.openide.filesystems.$Proxy0 with modifiers "public"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)
at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)
at java.lang.reflect.Constructor.newInstance(Constructor.java:413)
at org.openide.util.WeakListenerImpl$ProxyListener.<init>(WeakListenerImpl.java:403)
... 11 more

log查询的地址:C:\Users{username}.ireport\5.6.0\var\log

发现ireport 5.6 不能支持JDK 8, 那么这个我们需要手动去配置ireport使用JDK的版本,而不是用系统环境。

配置ireport JDK

1.需要本地安装有JDK 7
2.修改配置文件

在iReport安装目录下->etc->ireport.conf

修改

1
2
jdkhome="/path/to/jdk"

1
2
jdkhome="{JAVA_1_7_HOME}"

例如:

1
2
jdkhome="C:\Java\jdk1.7.0_79"