-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JavaCompiler: add output if no ToolsProvider
- Loading branch information
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,13 +39,15 @@ | |
|
||
import javax.tools.ToolProvider; | ||
|
||
import org.scijava.util.ClassUtils; | ||
import org.scijava.util.FileUtils; | ||
import org.scijava.util.ProcessUtils; | ||
|
||
/** | ||
* Encapsulates the Java compiler, falling back to command-line {@code javac}. | ||
* | ||
* @author Johannes Schindelin | ||
* @author Mark Hiner | ||
*/ | ||
public class JavaCompiler { | ||
protected PrintStream err, out; | ||
|
@@ -64,9 +66,15 @@ public void call(String[] arguments, | |
try { | ||
javax.tools.JavaCompiler sysc = ToolProvider.getSystemJavaCompiler(); | ||
if (sysc != null) { | ||
err.print("Found tools compiler: " + sysc.getClass()); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
hinerm
Author
Member
|
||
err.print(ClassUtils.getLocation(sysc.getClass())); | ||
sysc.run(null, out, err, arguments); | ||
return; | ||
} | ||
else { | ||
err.println("No java.tools.JavaCompiler available. Checking for explicit javac."); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
} | ||
|
||
if (javac == null) { | ||
JarClassLoader loader = discoverJavac(); | ||
Class<?> main = loader == null ? | ||
|
Do we want to emit output on stderr when the tool provider is found? Won't that cause this message to appear in the common case then?