Hello i try add some missing scripts like Mobs AI, and i put in scripts/ai/others/new/new.java
And i use correct imports for this and methods like others, but when loading i get NPE:
Failed to execute script list!
java.lang.NullPointerException: Cannot invoke "javax.tools.JavaFileObject.getName()" because the return value of "javax.tools.Diagnostic.getSource()" is null
at org.l2jmobius.gameserver.scripting.java.JavaExecutionContext.executeScripts(JavaExecutionContext.java:166)
Java Execution Context:
out.println("-----------------------");
out.println("Compilation diagnostics");
out.println("-----------------------");
for (Diagnostic<? extends JavaFileObject> diagnostic : compilationDiagnostics.getDiagnostics())
{
out.println("\t" + diagnostic.getKind() + ": " + diagnostic.getSource().getName() + ", Line " + diagnostic.getLineNumber() + ", Column " + diagnostic.getColumnNumber());
out.println("\t\tcode: " + diagnostic.getCode());
out.println("\t\tmessage: " + diagnostic.getMessage(null));
}
I think debugger try get source line and name to output, but in diagnostic.getSource() get Null instead of script code, why?
I try search about this in StackOverflow and some Java users say it's maybe can be if java run in JRE instead of JDK, but i use Bellsoft OpenJDK(from l2jmobius bitbucket readme.txt).
Has anyone had problems with this?
I remember that I faced this problem before and the temporary solution was to comment out this line, but maybe there is another normal solution?