Error generating report with JDK8
Using Netbeans IDE 8.0.2 and JDK8, when I try to generate a PDF report i get this error:
The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class filesvalue = ((java.lang.String)field_type.getValue()).contentEquals("XML"); //$JR_EXPR_ID=26$
This error occurs everytime I use this expression $F{type}.contentEquals("XML") or even the .equals expression. With JDK6 it doesn't happen.
I've searched the web and I find a fix for this but for ecliplse in this url: https://community.jaspersoft.com/jasperreports-server/issues/3498
My dependencies are:
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.6.0</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-fonts</artifactId>
<version>5.6.1</version>
</dependency>
Well i didnt find a perfect solution for this, although to walktrough this issue I used .endsWith() instead of .equals. Works in this situation.
链接地址: http://www.djcxy.com/p/91882.html上一篇: Java三元运算符与<JDK8兼容性中的if / else
下一篇: 使用JDK8生成报告时出错