Minecraft module not using correct java installation?

  • 113 Views
  • Last Post 5 weeks ago
  • Topic Is Solved
jrsrjrsr posted this 15 February 2020

I just updated my AMP release to v1.9.5.6. and now my MinecraftModule (allow updated to version 1.9.5.6) will not run. I am on Windows.

I believe the reason is that AMP is using the wrong installation of java. The logs show:

[07:50:27] [Core Debug] : Starting process C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe

However, my MinecraftModule.kvp file setting is:

Java.Path=C:\Program Files\Java\jdk-13.0.1\bin\java.exe

Because AMP starts the 32-bit client installation of java instead of the 64-bit server installation, it crashes when I try to use more memory than the 32-bit allows. The actual error message is: "Invalid maximum heap size: -Xmx4096M"

So, bottom line, why is AMP no longer using up the java executable specified in the MinecraftModule.kvp Java.Path setting?

Any help would be much appreciated.

Order By: Standard | Newest | Votes
Mike posted this 15 February 2020

Sanity check that the file exists, because AMP will fail silently if it doesn't and try and detect the path instead which it gets by querying the systems default Java path.

However as a rule, unless you've got something on the system that requires the 32 bit version of Java, you should simply remove any 32 bit versions entirely.

jrsrjrsr posted this 15 February 2020

Yes, the path exists. I successfully ran the minecraft server manually from the command line to make sure it worked outside of AMP. Besides, everything was just fine until I upgraded AMP; then it stopped working.

The issue here is that AMP is ignoring the Java.Path setting I give it. This seems like a bug to me, but I do not know how to debug the issue any further. Is there a way to increase the verbosity of the debugging any more?

Also, I do have applications on my machine that require the 32 bit java and so that is not an option.

jrsrjrsr posted this 16 February 2020

Here is some additional debugging info.

MinecraftModule.kvp Java settings:

Java.Path=C:\Program Files\Java\jdk-13.0.1\bin\java.exe
Java.MaxHeapSizeMB=2048
Java.UseSystemRAMAsTotal=False
Java.CustomOpts=

Validation that java binary exists:

 Directory of C:\Program Files\Java\jdk-13.0.1\bin

    01/11/2020  10:08 AM            50,728 java.exe
               1 File(s)         50,728 bytes
               0 Dir(s)  207,587,471,360 bytes free

Batch file created with Security.LogSensitiveProcArgs=True and Monitoring.ProduceStartupScripts=True

@ECHO OFF
REM Generated by AMP
cd /d "D:\MinecraftServerWorlds\"
"C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe" -Xmx2048M  -jar minecraft_server.jar nogui

AMPLOG output excerpts for fresh start of instance:

[06:58:16] [ModuleLoader Info]    : Loaded MinecraftModule version 1.0.0.3 by CubeCoders Limited
[06:58:16] [Minecraft Info]       : Java located at C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
[06:58:16] [Minecraft Warning]    : Java installation may be 32-bit! This could prevent the Minecraft server from starting.
[06:58:16] [Minecraft Debug]      : Java located at: C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
[06:58:16] [Minecraft Debug]      : Java start arguments: -Xmx2048M  -jar minecraft_server.jar nogui
[06:58:16] [Core Debug]           : Starting process C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
[06:58:16] [Core Debug]           : Working Directory: D:\MinecraftServerWorlds\
[06:58:16] [Core Debug]           : Arguments: -Xmx2048M  -jar minecraft_server.jar nogui
[06:58:16] [Core Debug]           : Started process with ID 5664
[06:58:16] [Minecraft Debug]      : Got info for Feed The Beast OK
[06:58:16] [Core Debug]           : Successfully got update data.
[06:58:16] [Core Info]            : AMP is up-to-date.
[06:58:16] [System Warning]       : The application stopped unexpectedly.
[06:58:16] [Minecraft Info]       : Java located at C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
[06:58:16] [Minecraft Warning]    : Java installation may be 32-bit! This could prevent the Minecraft server from starting.
Could not reserve enough space for 2097152KB object heap
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap

One other bit of information is that I normally run with 4 GB of memory, but changed the Java.MaxHeapSizeMB to 2 GB to make sure that AMP was reading the correct kvp configuration file. From above, it appears it picked up the change so it should also be getting the custom Java.Path setting.

Mike posted this 16 February 2020

Interesting. I will take a look into this on Monday.

jrsrjrsr posted this 5 weeks ago

Did you get a chance to look at this? Any other thoughts on what could be happening?

Mike posted this 5 weeks ago

It's already been fixed in the latest release.

jrsrjrsr posted this 5 weeks ago

I just updated and confirmed...everything's working now.

Thanks!

Close