NPE Error executing script! in gamesever load, after java10 support update

Issue #283 resolved
UchihaSV created an issue

1) Just clone last git from 2018-09-16 with java10 support update

2) Use gradlew.bat to build server

3) Fill mysql db and change setting in Server.properties and LoginServer.properties for mysql

4) run startLoginServer.bat - success

5) run startGameServer.bat - Error executing script! in [ Effects ] block

[23/09 20:05:10] -------------------------------------------------=[ Effects ]
[23/09 20:05:10] Error executing script!
java.lang.NullPointerException
        at org.mdkt.compiler.InMemoryJavaCompiler.compileAll(InMemoryJavaCompiler.java:80)
        at org.mdkt.compiler.InMemoryJavaCompiler.compile(InMemoryJavaCompiler.java:126)
        at com.l2jserver.gameserver.scripting.ScriptEngineManager.compileScript(ScriptEngineManager.java:179)
        at com.l2jserver.gameserver.scripting.ScriptEngineManager.executeScript(ScriptEngineManager.java:190)
        at com.l2jserver.gameserver.scripting.ScriptEngineManager.executeScript(ScriptEngineManager.java:197)
        at com.l2jserver.gameserver.handler.EffectHandler.executeScript(EffectHandler.java:65)
        at com.l2jserver.gameserver.GameServer.<init>(GameServer.java:197)
        at com.l2jserver.gameserver.GameServer.main(GameServer.java:460)

Exception in thread "main" java.lang.NullPointerException
        at com.l2jserver.gameserver.scripting.ScriptEngineManager.runMain(ScriptEngineManager.java:233)
        at com.l2jserver.gameserver.scripting.ScriptEngineManager.executeScript(ScriptEngineManager.java:192)
        at com.l2jserver.gameserver.scripting.ScriptEngineManager.executeScript(ScriptEngineManager.java:197)
        at com.l2jserver.gameserver.handler.EffectHandler.executeScript(EffectHandler.java:65)
        at com.l2jserver.gameserver.GameServer.<init>(GameServer.java:197)
        at com.l2jserver.gameserver.GameServer.main(GameServer.java:460)

PS: JDK version 10 (and set path JAVA_HOME in system variables), Windows 10

Comments (14)

  1. Nik “Cryops” S

    I was getting same errors. Found source - it was system variable pointing to jre instead of jdk. Else you can try to set absolute path to jdk 10 executable directly in startgameserver.bat maybe it helps...

  2. Nik “Cryops” S

    there is another variable "path" which among other paths pointing to java and it needed to set to jdk bin folder, like ...java\jdk-10\bin

    remove old java paths from there if any present and just in case - various paths needed to be separated by semicolon (;)

  3. Cesar A Gonzalez

    eh solved the error of the script load, modifying ( System Variables name: JAVA_HOME Variable value: C: \ Program ~ 1 \ Java \ jdk1.8.0_xxx) by ( System Variables Variable name: JAVA_HOME Variable value: C: \ Program ~ 1 \ Java \ jdk10.0.2_xxx) and also modify the PATH (C: \ ProgramData \ Oracle \ Java \ javapath; C: \ Program Files (x86) \ Common Files \ Oracle \ Java \ javapath; C: \ Program ~ 1 \ Java \ jdk1.8.0_xxx) by (C: \ Program Files \ Java \ jdk-10.0.2 \ bin) this worked for me 10, I hope that you too

  4. UchihaSV reporter

    Need change path in system variables by default - "C:\Program Files (x86)\Common Files\Oracle\Java" to your JDK 10 path with bin folder

  5. CostanzoPablo NA

    The answer is fine, but I put it somewhat clearer.

    Add JAVA_HOME variable: JAVA_HOME: C: \ Program Files \ Java \ jdk-10.0.2

    Remove from PATH variable: C: \ Program Files (x86) \ Common Files \ Oracle \ Java \ javapath

    Add to PATH variable: C: \ Program Files \ Java \ jdk-10.0.2 \ bin (at the beginning of everything)

    (do not forget to close the cmd window and reopen it, to do the test)

  6. Log in to comment