feat():测试
parent
5427bc562f
commit
051671a23c
|
@ -30,7 +30,7 @@ public class JavaFileCompile {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
|
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
|
||||||
String[] strings = {"-classpath","/home/lib","-verbose","-d", "/home/lib",fileName + MethodSuffix.JAVASUFFIX };
|
String[] strings = {"-classpath","/home/lib","-verbose","-d", "/home/lib","home/"+fileName + MethodSuffix.JAVASUFFIX };
|
||||||
// 执行编译任务
|
// 执行编译任务
|
||||||
int result = compiler.run(null, null, null, strings);
|
int result = compiler.run(null, null, null, strings);
|
||||||
// 检查编译结果
|
// 检查编译结果
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class OSSFileLoad {
|
||||||
}
|
}
|
||||||
//对路径里的.java文件进行编译
|
//对路径里的.java文件进行编译
|
||||||
System.out.println("第一步");
|
System.out.println("第一步");
|
||||||
JavaFileCompile.compile("home/"+fileName);
|
JavaFileCompile.compile(fileName);
|
||||||
// SourceCodeCompiler.javaCompilerPath("home/");
|
// SourceCodeCompiler.javaCompilerPath("home/");
|
||||||
// System.out.println("第二步");
|
// System.out.println("第二步");
|
||||||
// File outputDir = new File("home/"); // 或者是你指定的其他输出目录
|
// File outputDir = new File("home/"); // 或者是你指定的其他输出目录
|
||||||
|
|
Loading…
Reference in New Issue