Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Compilation that includes import statements #18

Open
Brookd23 opened this issue Oct 17, 2019 · 1 comment
Open

Dynamic Compilation that includes import statements #18

Brookd23 opened this issue Oct 17, 2019 · 1 comment

Comments

@Brookd23
Copy link

Brookd23 commented Oct 17, 2019

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?

@Brookd23
Copy link
Author

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

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant