Dynamic Compilation that includes import statements
I am trying to compile a java file (https://github.com/mkl-public/testarea-itext7/blob/master/src/main/java/mkl/testarea/itext7/extract/TextPlusYExtractionStrategy.java) , but the imports are not working and throw errors:
` import com.itextpdf.kernel.geom.Vector;
import com.itextpdf.kernel.pdf.canvas.parser.listener.LocationTextExtractionStrategy;
import com.itextpdf.kernel.pdf.canvas.parser.listener.TextChunk; `
But I get errors like:
error: cannot find symbol public class TextPlusYExtractionStrategy extends LocationTextExtractionStrategy ^ symbol: class LocationTextExtractionStrategy
The itext7 jars are included in the loadPaths provided to the JavaLoader.. and are available if manually instantiated via create() but the import statements on a dynamic compile doesn't seem to be able to find them.. any ideas?
Ok, so I tried putting all the itext7 JARS in the coldfusion\lib directory. I can see that they are now all loaded. I added loadColdFusionClassPath=true to the javaloader, and tried to compile this java file with the import statements, hoping those classes would now be available - but now I get the error below. I am on Java 11 on CF2016. Any thoughts?
` java.lang.reflect.InaccessibleObjectException: Unable to make public void jdk.internal.loader.BuiltinClassLoader.loadModule(java.lang.module.ModuleReference) accessible: module java.base does not "exports jdk.internal.loader" to unnamed module @655871e
`