在我的idea IDE中,我可以在控制台看到红色字体的编译错误。但是当我在linux服务器中部署jar时,我看不到编译日志。如何打印编译错误日志?
public static void main(String[] args) throws Exception {
String compliePath="D:\\testFole";
String filename="D:\\test.java";
String[] arg = new String[] { "-d", compliePath, filename };
System.out.println(com.sun.tools.javac.Main.compile(arg));
}