I tried to run my first program using following the guide in your website(Generate Word DOC from Templates in Java | Create Word Docs) using eclipse IDE and 1.8 jre. But got this warnings
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.aspose.words.internal.zz3L (file:/C:/Users/…/.m2/repository/com/aspose/aspose-words/21.6/aspose-words-21.6-jdk17.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.aspose.words.internal.zz3L
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
The source code is as follows:
import com.aspose.words.*;
public class Test {
public static void main(String[] args) throws Exception {
// Create Document object and initialize with DOCX template.
Document doc = new Document("D:/KEP/test.docx");
// Create Sender object.
Sender sender = new Sender("LINQ Reporting Engine", "Hello World");
// Create ReportingEngine object.
ReportingEngine engine = new ReportingEngine();
// Build report.
engine.buildReport(doc, sender, "s");
// Save as Word document.
doc.save("word.docx");
}
}
public class Sender {
public Sender(String name, String message) {
_name = name;
_message = message;
}
public String getName() {
return _name;
}
public String getMessage() {
return _message;
}
private String _name;
private String _message;
}
Thank you in advance!