VSCode + Java 11
I am using the Apache commons libraries for a number of things in my project, specifically org.apache.commons.csv
and org.apache.commons.io
.
I am including the jar files for both in my classpath
and I was building just fine until I put my code in a Java module for packaging.
Now I get import
errors saying the packages are inaccessible, such as org.apache.commons.csv is not accessible
.
If I try and refer to them directly in my own module-info.java
like this...
module com.hupa {
exports com.hupa.alg.cluster;
requires jdk.xml.dom;
requires org.apache.commons.csv;
}
I get the error org.apache.commons.csv cannot be resolved to a module
, which seems correct as there is no module defined for it.
I am at a bit of a loss about what to do. There is no module-info.java
or module-info.class
in the jars I have for these libraries. How am I supposed to refer to them as dependencies for my project?