I am pretty new to java and I am trying to import some classes into my Java project, particularly java.sql and java.io.FileWriter + java.io.BufferedWriter
In my module-info.java, I have added the lines:
module Mynewmodule {
requires java.sql;
requires java.io;
}
However, "requires java.io;" throws "java.io cannot be resolved to a module". Any idea on how I can import java.io to later use java.io.FileWriter and java.io.BufferedWriter?
java.iois not a module. It is a package, and it exists inside thejava.basemodule which is the default one. Therefore, you don't need that line. You only need toimportthe relevant classes in your source file.