5

I've been trying to get my report working for few days but still no luck. I have no idea if it's something wrong with the dependencies.

I asked this question previously.

Anyway i just want to know if anyone have used JasperReports 6 with JDK 8? after all i doubt if these are compatible.

Community
  • 1
  • 1
Hasith Magage
  • 543
  • 4
  • 20
  • 1
    possible duplicate of [What version of JaspeReports has support for Java 8?](http://stackoverflow.com/questions/23315545/what-version-of-jaspereports-has-support-for-java-8) – Jens Mar 10 '15 at 08:02

2 Answers2

4

Update your JDT

   <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports</artifactId>
        <version>5.6.1</version>
        <exclusions>
            <exclusion>
                <groupId>eclipse</groupId>
                <artifactId>jdtcore</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.eclipse.jdt.core.compiler</groupId>
        <artifactId>ecj</artifactId>
        <version>4.4</version>
    </dependency>

Source : How to Run JasperReport with Java 8

Neeraj Jain
  • 7,643
  • 6
  • 34
  • 62
4

I just figured out the issue after trying few days. My report didn't work not due to an incompatibility issue. But because i haven't used

JasperPrint jp = JasperFillManager.fillReport(jr, param, new JREmptyDataSource());

instead of

JasperPrint jp = JasperFillManager.fillReport(jr, param);

Yes. JDK 8 is compatible with JasperReports 6.

JasperReports doesn't have enough community support i had to figure this out by my self. Anyway i suggest that JasperReports library should be much improved.

Hasith Magage
  • 543
  • 4
  • 20