Description of problem: From javac man page, section "PROGRAMMATIC INTERFACE": EXAMPLE To compile as though providing command-line arguments, use the following syntax: JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); I believe it's a bug. Second line of the code snippet is the same as a first one. Same example, but in older version of the javac man page [1] looks like following: JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); int rc = javac.run(null, null, null, args); Which seems to be much better. [1]: http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/javac.html Version-Release number of selected component (if applicable): java-1.8.0-openjdk-devel-1.8.0.5-4.b13.fc21.x86_64
Filed upstream: https://bugs.openjdk.java.net/browse/JDK-8042840
Transferred to upstream, please track the bug in comment #1 instead of this one.