Код: Выделить всё
public class Test {
private static String programsDir = "C:\\programs\\";
private static String compiledDir = "C:\\compiled\\";
private static String fileName = "HelloWorld.java";
public static void main(String[] args){
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
String arguments = "-d " + compiledDir + " " + programsDir + fileName ;
compiler.run(System.in, System.out, System.err, arguments);
}
Код: Выделить всё
javac: file not found: -d C:\compiled\ C:\programs\HelloWorld.java
Usage: javac
use -help for a list of possible options
Подробнее здесь: https://stackoverflow.com/questions/148 ... uments-arg
Мобильная версия