<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>${jasperreports.version}</version>
</dependency>
createPDF("./students.jasper");
with compiled jasper file
public static void createPDF(String jasperFile){
List studentList = new ArrayList<>();
studentList.add(new Student("Lisa", "Mayer"));
studentList.add(new Student("Patrick", "Huber"));
studentList.add(new Student("Werner", "Reiter"));
studentList.add(new Student("Bettina", "Gruber"));
studentList.add(new Student("Dominik", "Berner"));
JRBeanCollectionDataSource beanColDataSource = new JRBeanCollectionDataSource(studentList);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperFile, new HashMap(), beanColDataSource);
JasperExportManager.exportReportToPdfFile(jasperPrint, "students.pdf"); // see attachment students.pdf
}