I'm trying to use the spire.office.free library to manage office files from java. For this I have a project using spring tool suite with maven for the download of that library. The problem is that when I run the code I get the following error.
Exception in thread "main" java.lang.IllegalAccessError: class com.spire.office.packages.sprkzh (in unnamed module @0x29647f75) cannot access class sun.security.action.GetPropertyAction (in module java.base) because module java.base does not export sun.security.action to unnamed module @0x29647f75
at com.spire.office.packages.sprkzh.spr??(Unknown Source)
at com.spire.office.packages.sprkzh.spr??(Unknown Source)
at com.spire.office.packages.sprkzh.<init>(Unknown Source)
at com.spire.office.packages.sprfqg.<init>(Unknown Source)
at com.spire.office.packages.sprhqg.<init>(Unknown Source)
at com.spire.xls.core.spreadsheet.XlsWorkbook.<init>(Unknown Source)
at com.spire.xls.Workbook.<init>(Unknown Source)
at Eu.Extrae.Principal.main(Principal.java:21)
At this moment java console informs me that it is not able to access the code of the library
Class file editor
The curious thing about the matter is that if I download the spire.office.free and use it as an external library the problem disappears and everything works correctly. I know that is a solution to the problem but I prefer to use maven in any case
Any solution?
Thanks in advance
You muss download and add Jar file. I have this problem with excel, and I added the jar build path/configure build pat/maven dependencies and add the downloaded jar and problem solved