Jump to content

Recommended Posts

Posted (edited)

Hello, i have got a problem with my servers. When i started the server with more than 1G it don´t worked but if i started it with lower it worked:

java -Xms2G -Xmx2G -jar forge-1.12.2-14.23.2.2632-universal.jar nogui
pause

It crashed every time and wrote to me this:

java -Xms2G -Xmx2G -jar forge-1.12.2-14.23.2.2632-universal.jar nogui
Error occurred during initialization of VM

Could not reserve enough space for 2097152KB object heap

But i have free enough RAM for this so i tried to fix it and at this page and i found some answers: https://bukkit.org/threads/complex-craftbukkit-server-and-java-problem-could-not-reserve-enough-space-for-object-heap.155192/

But it still don´t work and now it wrote to me this:                  After trying to fix it by changing "(automatically) poorly set environment variable" 

A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:62)
        at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:31)
Caused by: java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader
        at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
        ... 6 more

I will be so much happy if will someone help me with this, because I have every time started servers with only 1G and now 1G don´t works too.

Edited by VlkOfficial
Posted

Please post the output of java -version from your commandline, it will show the version of java that is being used by default/in the path.

 

It may be that you have Java 8 and 9 installed, but 9 is the one on your path.

Posted
On 26. 3. 2018 at 3:59 PM, Ugdhar said:

Please post the output of java -version from your commandline, it will show the version of java that is being used by default/in the path.

 

It may be that you have Java 8 and 9 installed, but 9 is the one on your path.

When i did what you said it wrote this: java -version
java version "10" 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)

Posted

You can always run a specific version of java by using the full path to the java executable.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

After reinstalling Java it wrote after starting server this: 

Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap

But i know that i have enough free space. So after that i checked again cmd it wrote this:

java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode)

Posted

Well ya.. I highly doubt your computer has 2TB of ram to dedicate to the server... you seem to of messed up how you're setting the needed ram.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

He means this : "Could not reserve enough space for 2097152KB", which is roughly 2tb.
Are you sure you are using the correct launch arguments?
Check the contents of your "run.bat" or whatever you use.

Try this instead: -Xms256m -Xmx2048m

Posted
1 hour ago, Ruukas said:

Could not reserve enough space for 2097152KB", which is roughly 2tb.

2097152KB / 1024 = 2048MB / 1024 = 2GB

 

There is no mention of 2TB anywhere in the errors. . .

  • Haha 1
Posted

Haha, you are right. At first I got it to 2gb too, but then somehow I managed to get it to 2tb, after calculating a couple of times. I guess I kind of forced it.

Posted
5 hours ago, Ruukas said:

He means this : "Could not reserve enough space for 2097152KB", which is roughly 2tb.
Are you sure you are using the correct launch arguments?
Check the contents of your "run.bat" or whatever you use.

Try this instead: -Xms256m -Xmx2048m

I did what you said but it wrote again: Could not reserve enough space for 2097152KB

I rlly don´t know what can i do with it...

Posted (edited)
30 minutes ago, diesieben07 said:

OK, after I downloaded this new Java offline (64) because Java online downloaded to Frogram Files x86 and how did I got know there are Java versions 32-bit. I checked server, cmd and where is Java downloaded.

Now Java is in C:\Program Files\Java\jre1.8.0_161

cmd was: java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

And server after starting with:

java -Xms256m -Xmx2048m -jar forge-1.12.2-14.23.2.2632-universal.jar nogui
pause 

WORKS!!!

Thank you all so much, now i know that it was only because I am idiot and I had problem that I can fix too. :D

 

 

Edited by VlkOfficial

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.