【发布时间】:2020-12-27 17:23:58
【问题描述】:
在我的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));
}
【问题讨论】:
标签: java compiler-errors tools.jar