mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
check if JavaCompiler is avaliable. #799
This commit is contained in:
@@ -25,6 +25,11 @@ public class DynamicCompiler {
|
||||
private final List<Diagnostic<? extends JavaFileObject>> warnings = new ArrayList<Diagnostic<? extends JavaFileObject>>();
|
||||
|
||||
public DynamicCompiler(ClassLoader classLoader) {
|
||||
if (javaCompiler == null) {
|
||||
throw new IllegalStateException(
|
||||
"Can not load JavaCompiler from javax.tools.ToolProvider#getSystemJavaCompiler(),"
|
||||
+ " please confirm the application running in JDK not JRE.");
|
||||
}
|
||||
standardFileManager = javaCompiler.getStandardFileManager(null, null, null);
|
||||
|
||||
options.add("-Xlint:unchecked");
|
||||
|
||||
Reference in New Issue
Block a user