I'm having a similar problem to what 64fanatic described, only his fix doesn't seem to work to me. I substituted the original install file from the OP with the OpenJDK file recommended by 64fanatic and it seems to install just fine, but when I go to check the version of java, I get an error that states:
Error occurred during initialization of VM
Could not reserve enough space for object heap
I think CentOS takes issue with OpenJDK, as when I installed the 1.4 version of Java recommended by the OP, the server would try and start but couldn't because of outdated java. Now, it just does the above.
Is there anyone willing to help walk me through this? I'm rather new to linux and the OPs guide was invaluable in figuring out what I needed to be doing, but I'm pretty stuck here. While CentOS is currently what is on my VPS, it can be any linux distro you are familiar with if you're willing to help me.
Thanks, guys.
-Ashley
Rollback Post to RevisionRollBack
Host of the 2 Girls 1 Game indie gaming podcast.
2G1G Minecraft server proudly provided by Brohoster. "She's like Beetlejuice, except she's not dead and you summon her with the word 'indie'."
You need 1024 mb minimum or it gets really laggy and nasty.
Avoid VPS hosting providers that use OpenVZ to virtualize linux. It cannot handle java programs in RAM very well due to non contiguous memory blocks. If you use a VPS that forces OpenVZ, your java programs will need twice the RAM just to run. You can avoid this by choosing a VPS hosting provider that uses Xen for virtual machines instead.
VPS.net is an excellent example. It is similar to Amazon's EC2 as they employ cloud virtual hosting. They use Xen, and sell nodes at decent prices, allow you to use SWAP (virtual memory using hard drive space) and use solid state disks to make SWAP more viable. They also allocate dedicated CPU speed to your VPS node(s) so other users don't impact your node(s). I use two nodes with 756mb RAM but still can set my minecraft alpha server to 1024mb -xms while hosting another java server, mysql server, apache server, ftp server using Ubuntu 10.10 on only two nodes. My server is nearly lag free, website loads very quickly, and I don't see any overall slow downs what so ever.
okay Ive done all this and it worked flawlessly, now how do I connect to the server? What ports do I open, how do I find the external IP that others should connect to?
I think Ive opened the port by using iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 5900 -j ACCEPT
I can set up the server successfully on a VPS host, but when I try to connect I simply get a black screen. Its finding the server (because it used to give me a timeout message) but nothing happens with my client. Anyone got any insight?
now i have the following problem: whenever i close puty the server stops
Run the program "screen". You may need to install it first. When you run it, you'll get a little message, and when you hit enter to skip it you'll get another command prompt. Now you're attached to a virtual screen that has the ability to keep running after you log out, as long as you disconnect from it correctly. For example, once you're in the screen, run top. Once it's up and running, hit CTRL-a, then d. You should get something like "[detached from 9708.pts-1.hostname]" and you'll be back at the prompt where you first ran screen. It's kinda confusing at first.
Top is still running in the background, on that other virtual screen. If you were to log out right here, top will continue to run forever. To get back to it, run "screen -r" (-r for reattach). Now you should have top again. Quit top.
To close the screen for good, hit CTRL-a, then k (for kill). There should be a prompt at the bottom of the window: "Really kill this screen?" Hit Y. Now the screen is totally gone, along with any programs that were running under it.
Just run minecraft instead of top, and that's how I do it. Hope that helps.
EDIT: To be clear, you don't want to kill the screen unless you're rebooting the machine or something, and you'll want to stop the minecraft server gracefully first.
I am using Debian, and am a total noob to Linux... I have followed this but when I run the server as described...
First time I run it, it gives me a warning that server.properties does not exist and the server stops... so I run it again... this second (and every time I run it going forward) time I don`t get the server.properties warning, but it still shuts down again.... no explanation given at all. (nothing in the server.log file either)
Any ideas? I think the problem is my Java is not up to date... not sure how to get it updated... I've gone to java.com and followed all the instructions etc... still nadda... when I do a java -version command it still shows as 1.5
I guess I should start by asking if anyone can describe in good detail for a noob exactly how to update java on Debian 5 (Lenny)...
I have tried I **** you not, 3 days and 4 different VPS companys and dumped at least 130$ to get a dam VPS to run my server,
[root@bmth mc]# java -Xmx1024 -Xms1024M -jar minecraft_server.jar nogui
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
[root@bmth mc]# java -Xmx1024 -Xms1024M -jar minecraft_mod.jar nogui
Unable to access jarfile minecraft_mod.jar
[root@bmth mc]# java -Xmx1024 -Xms1024M -jar minecraft_server.jar nogui
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
[root@bmth mc]# java -Xmx512 -Xms512M -jar minecraft_server.jar nogui
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
[root@bmth mc]# java -Xmx512 -Xms1024M -jar minecraft_server.jar nogui
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
[root@bmth mc]# java -Xmx1024 -Xms2048M -jar minecraft_server.jar nogui
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
[root@bmth mc]#
Updated java, updated everything, VPS has the stats for it, it's Xen, what ****ing else is there?
The Meaning of Life, the Universe, and Everything.
Location:
Missouri
Join Date:
9/5/2010
Posts:
46
Minecraft:
Furt
Member Details
[Solved]
i just xfered my server to linux and im having problems
im using hey0's mod for starters.
when i run java -Xms1024M -Xmx1024M -jar Minecraft_Mod.jar nogui
i get this error...
[root@crimson-effect minecraft]# java -Xmx1024M -Xms1024M -jar Minecraft_Mod.jar nogui
Exception in thread "main" java.lang.NoClassDefFoundError: FlatFileSource
at java.lang.Class.initializeClass(libgcj.so.7rh)
at etc.loadData(etc.java:121)
at bp.<init>(bp.java:7)
at net.minecraft.server.MinecraftServer.<init>(SourceFile:40)
at net.minecraft.server.MinecraftServer.main(SourceFile:471)
at Main.main(Main.java:28)
Caused by: java.lang.ClassNotFoundException: java.util.Scanner not found in gnu.gcj.runtime.SystemClassLoader{urls=[file], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.7rh)
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
at java.lang.Class.forName(libgcj.so.7rh)
at java.lang.Class.initializeClass(libgcj.so.7rh)
...5 more
is there something else i need to install on the server besides java?
im using hazenet vps if this helps.
Edit: found the issue "yum install java-gcj-compat" installs java 1.4 now
so i had to use "yum install java-1.6.0-openjdk" and everything works now.
Also, you have got to have 1GB of RAM ( 1024MB ) otherwise It complains that you haven't allocated enough memory.
After installing java-1.6.0-openjdk, you need to make sure that this is reported:
[root@blacksmythe] java -version
java version "1.6.0"
OpenJDK Runtime Environment (build 1.6.0-b09)
OpenJDK Client VM (build 1.6.0-b09, mixed mode)
This works fine on a bare bones CentOS 5.4 installation.
[Do] you have any idea why mine is constantly using all the ram i allocate it, whether or not java is using it at the moment? like java would be using 500mB and my ram load would still be 2.4gB
Well, the image isn't loading, so I can't comment on anything specific to your case. I can give you some general advice, though.
Linux memory usage is not the same as Windows memory usage. Typically, Linux will make use of as much RAM as possible. But, just because memory is "used" does not mean it isn't available to programs. To explain further, I've included a snippet from the output of top on an actual server with Minecraft running:
Mem: 1001540k total, 992188k used, 9352k free, 71248k buffers
Swap: 1047544k total, 4832k used, 1042712k free, 75824k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4712 mine 20 0 923m 791m 13m S 2 81.0 79:46.35 java
This machine has 1GB of RAM (seen as 1001540k total). It shows 992188k used, which is almost all of it, right? Well, yes, but the 71248k buffers and 75824k cached numbers are important in determining how much RAM is really available for use. Buffers represents files that are stored in RAM to speed up access to these files. Cached represents memory pages that were recently used and are saved to speed up access in case they are needed again. Any process requiring more RAM takes priority over buffers and cached.
To find the total memory "available," you need to add up the 9352k free, 71248k buffers, and 75824k cached values (156424k in this case).
Now, to find the actual memory "used" by a process, look at the RES field. In this case, it is 791m, which is pretty darn close to the Xmx768M/Xms768M parameters used to start java on this machine. This number is also comparable to the value you would see when checking on a program in the Windows Task Manager.
I have a porblem all I get is:
2010-10-06 16:36:52 [INFO] Starting minecraft server version 0.2.1
2010-10-06 16:36:52 [INFO] Loading properties
2010-10-06 16:36:52 [INFO] Starting Minecraft server on *:25565
2010-10-06 16:36:53 [INFO] Stopping server
Since my main os is XP sp3 and the server doesn't work on it, I tried using Ubuntu 10.04 in vm to run the server. I got the server up and running by following the instructions but i can't connect to it on my computer or another computer even though the server is up (I get the connection refused: connect message). I have the port forwarded using XP's ip not the vm's ip (router is a netgear).
Is the problem with Ubuntu or something else?
Since my main os is XP sp3 and the server doesn't work on it, I tried using Ubuntu 10.04 in vm to run the server. I got the server up and running by following the instructions but i can't connect to it on my computer or another computer even though the server is up (I get the connection refused: connect message). I have the port forwarded using XP's ip not the vm's ip (router is a netgear).
Is the problem with Ubuntu or something else?
If you have the network connection of the VM set up as bridged (it gets an IP directly from the Netgear router), then the port needs to be forwarded to the IP of the VM. If you have it set up as NAT (it gets an IP from XP), then.... change it to bridged. It would be technically possible to do it with 2 layers of NAT, but there is no real benefit in your situation and it just overly complicates things.
Port forwarding aside, you should be able to connect directly to the server via its internal IP address. This will allow you to see that it is actually running.
I have a porblem all I get is:
2010-10-06 16:36:52 [INFO] Starting minecraft server version 0.2.1
2010-10-06 16:36:52 [INFO] Loading properties
2010-10-06 16:36:52 [INFO] Starting Minecraft server on *:25565
2010-10-06 16:36:53 [INFO] Stopping server
I get exactly the same message. Can anyone please help with this?
Just want to say thanks for posting this helpful tutorial. I've successfully started up a server and it's been running fine now for 24 hours or so. My problem is I used this command..
to run the server without the screen showing, and now I can't get back into the screen to shut down the server (using the "stop" command). I'm completely new to linux terminal.
I think CentOS takes issue with OpenJDK, as when I installed the 1.4 version of Java recommended by the OP, the server would try and start but couldn't because of outdated java. Now, it just does the above.
Is there anyone willing to help walk me through this? I'm rather new to linux and the OPs guide was invaluable in figuring out what I needed to be doing, but I'm pretty stuck here. While CentOS is currently what is on my VPS, it can be any linux distro you are familiar with if you're willing to help me.
Thanks, guys.
-Ashley
2G1G Minecraft server proudly provided by Brohoster.
"She's like Beetlejuice, except she's not dead and you summon her with the word 'indie'."
External server browser: Created by me, made for you.Not working atm, and will not get updated in the near future, sorry.
Avoid VPS hosting providers that use OpenVZ to virtualize linux. It cannot handle java programs in RAM very well due to non contiguous memory blocks. If you use a VPS that forces OpenVZ, your java programs will need twice the RAM just to run. You can avoid this by choosing a VPS hosting provider that uses Xen for virtual machines instead.
VPS.net is an excellent example. It is similar to Amazon's EC2 as they employ cloud virtual hosting. They use Xen, and sell nodes at decent prices, allow you to use SWAP (virtual memory using hard drive space) and use solid state disks to make SWAP more viable. They also allocate dedicated CPU speed to your VPS node(s) so other users don't impact your node(s). I use two nodes with 756mb RAM but still can set my minecraft alpha server to 1024mb -xms while hosting another java server, mysql server, apache server, ftp server using Ubuntu 10.10 on only two nodes. My server is nearly lag free, website loads very quickly, and I don't see any overall slow downs what so ever.
My $0.02
I think Ive opened the port by using iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 5900 -j ACCEPT
and i think i have the correct IP but im guessing
I still cant connect?
Run the program "screen". You may need to install it first. When you run it, you'll get a little message, and when you hit enter to skip it you'll get another command prompt. Now you're attached to a virtual screen that has the ability to keep running after you log out, as long as you disconnect from it correctly. For example, once you're in the screen, run top. Once it's up and running, hit CTRL-a, then d. You should get something like "[detached from 9708.pts-1.hostname]" and you'll be back at the prompt where you first ran screen. It's kinda confusing at first.
Top is still running in the background, on that other virtual screen. If you were to log out right here, top will continue to run forever. To get back to it, run "screen -r" (-r for reattach). Now you should have top again. Quit top.
To close the screen for good, hit CTRL-a, then k (for kill). There should be a prompt at the bottom of the window: "Really kill this screen?" Hit Y. Now the screen is totally gone, along with any programs that were running under it.
Just run minecraft instead of top, and that's how I do it. Hope that helps.
EDIT: To be clear, you don't want to kill the screen unless you're rebooting the machine or something, and you'll want to stop the minecraft server gracefully first.
First time I run it, it gives me a warning that server.properties does not exist and the server stops... so I run it again... this second (and every time I run it going forward) time I don`t get the server.properties warning, but it still shuts down again.... no explanation given at all. (nothing in the server.log file either)
Any ideas? I think the problem is my Java is not up to date... not sure how to get it updated... I've gone to java.com and followed all the instructions etc... still nadda... when I do a java -version command it still shows as 1.5
I guess I should start by asking if anyone can describe in good detail for a noob exactly how to update java on Debian 5 (Lenny)...
External server browser: Created by me, made for you.Not working atm, and will not get updated in the near future, sorry.
[root@bmth mc]# java -Xmx1024 -Xms1024M -jar minecraft_server.jar nogui
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
[root@bmth mc]# java -Xmx1024 -Xms1024M -jar minecraft_mod.jar nogui
Unable to access jarfile minecraft_mod.jar
[root@bmth mc]# java -Xmx1024 -Xms1024M -jar minecraft_server.jar nogui
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
[root@bmth mc]# java -Xmx512 -Xms512M -jar minecraft_server.jar nogui
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
[root@bmth mc]# java -Xmx512 -Xms1024M -jar minecraft_server.jar nogui
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
[root@bmth mc]# java -Xmx1024 -Xms2048M -jar minecraft_server.jar nogui
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
[root@bmth mc]#
Updated java, updated everything, VPS has the stats for it, it's Xen, what ****ing else is there?
i just xfered my server to linux and im having problems
im using hey0's mod for starters.
when i run java -Xms1024M -Xmx1024M -jar Minecraft_Mod.jar nogui
i get this error...
[root@crimson-effect minecraft]# java -Xmx1024M -Xms1024M -jar Minecraft_Mod.jar nogui
Exception in thread "main" java.lang.NoClassDefFoundError: FlatFileSource
at java.lang.Class.initializeClass(libgcj.so.7rh)
at etc.loadData(etc.java:121)
at bp.<init>(bp.java:7)
at net.minecraft.server.MinecraftServer.<init>(SourceFile:40)
at net.minecraft.server.MinecraftServer.main(SourceFile:471)
at Main.main(Main.java:28)
Caused by: java.lang.ClassNotFoundException: java.util.Scanner not found in gnu.gcj.runtime.SystemClassLoader{urls=[file], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.7rh)
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
at java.lang.Class.forName(libgcj.so.7rh)
at java.lang.Class.initializeClass(libgcj.so.7rh)
...5 more
is there something else i need to install on the server besides java?
im using hazenet vps if this helps.
Edit: found the issue "yum install java-gcj-compat" installs java 1.4 now
so i had to use "yum install java-1.6.0-openjdk" and everything works now.
The first post w/ instructions needs to be updated. You need java-1.6.0-openjdk to run.
Also, you have got to have 1GB of RAM ( 1024MB ) otherwise It complains that you haven't allocated enough memory.
After installing java-1.6.0-openjdk, you need to make sure that this is reported:
This works fine on a bare bones CentOS 5.4 installation.
Well, the image isn't loading, so I can't comment on anything specific to your case. I can give you some general advice, though.
Linux memory usage is not the same as Windows memory usage. Typically, Linux will make use of as much RAM as possible. But, just because memory is "used" does not mean it isn't available to programs. To explain further, I've included a snippet from the output of top on an actual server with Minecraft running:
This machine has 1GB of RAM (seen as 1001540k total). It shows 992188k used, which is almost all of it, right? Well, yes, but the 71248k buffers and 75824k cached numbers are important in determining how much RAM is really available for use. Buffers represents files that are stored in RAM to speed up access to these files. Cached represents memory pages that were recently used and are saved to speed up access in case they are needed again. Any process requiring more RAM takes priority over buffers and cached.
To find the total memory "available," you need to add up the 9352k free, 71248k buffers, and 75824k cached values (156424k in this case).
Now, to find the actual memory "used" by a process, look at the RES field. In this case, it is 791m, which is pretty darn close to the Xmx768M/Xms768M parameters used to start java on this machine. This number is also comparable to the value you would see when checking on a program in the Windows Task Manager.
--
Andy
2010-10-06 16:36:52 [INFO] Starting minecraft server version 0.2.1
2010-10-06 16:36:52 [INFO] Loading properties
2010-10-06 16:36:52 [INFO] Starting Minecraft server on *:25565
2010-10-06 16:36:53 [INFO] Stopping server
Is the problem with Ubuntu or something else?
If you have the network connection of the VM set up as bridged (it gets an IP directly from the Netgear router), then the port needs to be forwarded to the IP of the VM. If you have it set up as NAT (it gets an IP from XP), then.... change it to bridged. It would be technically possible to do it with 2 layers of NAT, but there is no real benefit in your situation and it just overly complicates things.
Port forwarding aside, you should be able to connect directly to the server via its internal IP address. This will allow you to see that it is actually running.
--
Andy
I get exactly the same message. Can anyone please help with this?
Just want to say thanks for posting this helpful tutorial. I've successfully started up a server and it's been running fine now for 24 hours or so. My problem is I used this command..
to run the server without the screen showing, and now I can't get back into the screen to shut down the server (using the "stop" command). I'm completely new to linux terminal.
Any help is appreciated