Problems when deploying on Windows - Cant create Java Virtual Machine

Hi everyone,

I’m having problems with the Windows deployment and I can’t figure out what it can be.
I build my project following all the steps on the tutorials and everything goes OK, the game works perfectly on my computer.
However, when I try to run it on any other computer I get the following error:

Cant create Java Virtual Machine. Program will now exit

I’ve checked that the other computers have Java installed, but it seems that’s not the problem.

Do you have any clue about what is happening?

Thank you

Hard to say anything without more data, but from my experience, in 90% of the cases it is because of memory settings going over the magic treshold for given startup of windows. If you have -Xmx bigger than 1GB, try to set it down to 1GB and see if it works then.

Usually, a hint for the root cause is given before the “Cannot create Java Virtual Machine” message.

Thanks for your replies,

abies answer solved the problem.

¡Thanks a lot! :slight_smile:

<cite>@abies said:</cite> Hard to say anything without more data, but from my experience, in 90% of the cases it is because of memory settings going over the magic treshold for given startup of windows. If you have -Xmx bigger than 1GB, try to set it down to 1GB and see if it works then.

Actuially windows 32bit cannot use more than 1 gb ram per process (if the process does not use pae librarys and java doesn’t)
with a 64 windows you could use way higher values.

@Empire Phoenix said: Actuially windows 32bit cannot use more than 1 gb ram per process (if the process does not use pae librarys and java doesn't) with a 64 windows you could use way higher values.

According to the task manager, my Java apps (when max mem and max direct heap are set appropriately) routinely use 1.6 gig or more on Windows XP 32 bit. I can’t set Xmx much more than a gig, though. More than half of that is direct buffers.

I think that windows 32-bit process can use around 2GB of memory. Java can access less, because it requires heap to be continous and part of that 2GB is riddled with some dll private space, which seems to be not relocatable per-process. This means that depending on installation and order of programs started, you can different limits even on same machine. From experience, I was never able to get more than 1.4GB, but almost always able to get 1.1GB. Anything in between depends on luck.