开发者

how to specify options when using JavaCompiler interface

 Ja开发者_开发技巧vaCompiler compiler = ToolProvider.getSystemJavaCompiler();
        compiler.run(null, null, null, "cp", System.getProperties().getProperty("java.class.path"), sourceFile.getPath());

this not work, how to pass classpath option to JavaCompiler instance ?


You need to precede the argument with '-' i.e. -cp or -classpath as if you would use the command line javac. See also javac

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜