I set up a Minecraft SMP server under Ubuntu 10.04. When I run the server jar file, which is located in a sub-directory of my home folder, all of the server config files and world folder are generated under my home folder instead of the server folder. This is really annoying. I want all of my server files to be located in my minecraft server folder. Is there some sort of switch I can use in order to set the working directory of the minecraft server?
The script that I run the server with looks like this, if it makes any difference.
java -server -Xmx2048m -Xms2048m -Xmn1024m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:+DisableExplicitGC -XX:+UseAdaptiveGCBoundary -XX:MaxGCPauseMillis=500 -XX:-UseGCOverheadLimit -XX:ParallelGCThreads=2 -XX:+AggressiveOpts -jar /home/ben/minecraft/server/minecraft_server.jar nogui
Latest News Article
Minecraft Monday Show - Let's Play Killers & Great Downloads!
This week, BebopVox covers the recent drama with "Let's Play" videos (including Mojang's stance on the matter), and much more!...
Minecraft Video Trailer: "Relapse"
Looking for a sci-fi adventure set inside Minecraft? fngnation is, and can't wait to release this awesome space-opera thriller, called "Relapse"! While this is just a trailer of the upcoming movie, it's definitely worth a watch, so ...
Minecraft Parody: "Grieferman"
Most of you have seen Psy's recent new song, "Gentleman". It's not too often that I run across a parody that's better than the original, but StageFiveTV's parody, "Grieferman", definitely nailed it! Clever lyrics, ...
how do I change the location of server data files?
Started by
super coffee
, Feb 12 2011 06:58 AM
9 replies to this topic
#1
Posted 12 February 2011 - 06:58 AM
#2
Posted 12 February 2011 - 07:02 AM
Are you running the script from your home directory?
Are the files showing up in your /blah..blah/home/yournamehere directory or are they in /blah..blah/home/yournamehere/minecraft directory?
Are the files showing up in your /blah..blah/home/yournamehere directory or are they in /blah..blah/home/yournamehere/minecraft directory?
#3
Posted 12 February 2011 - 07:06 AM
I am running the script from the same directory as the server jar files which is /home/ben/minecraft/server.
The files for the server such as world, server.properties and so on are being created in /home/ben.
I want the files to be created in /home/ben/minecraft/server.
The files for the server such as world, server.properties and so on are being created in /home/ben.
I want the files to be created in /home/ben/minecraft/server.
#4
Posted 12 February 2011 - 07:07 AM
The files for the server have to be and will always be in the same folder as the JAR file. Move the JAR and subsequent server files to your preferred directory and adjust the code you use to start the server to match the new location of the JAR file.
#5
Posted 12 February 2011 - 07:14 AM
rch said:
The files for the server have to be and will always be in the same folder as the JAR file. Move the JAR and subsequent server files to your preferred directory and adjust the code you use to start the server to match the new location of the JAR file.
That has always worked for me in Windows. For some reason though under Ubuntu, it always makes the files under the home folder. It doesn't matter if I start it with the script or not. Even running the jar without any options still creates server files under the home directory.
#6
Posted 12 February 2011 - 07:22 AM
Well it is possible to do some fancy redirecting of data with pipes and such.
However the minecraft server is hard coded to look for and create the files in a subdirectory of where the .jar is run from. Have you tried moving the minecraft_server.jar to another location? Perhaps a deeper subdirectory /home/ben/mystuff/testing/minecraft for example or /usr/minecraft or even /var/minecraft.
How did you get the minecraft_server.jar? Did you download it from minecraft.net or did you use some sort of package?
You're also doing some very strange things to your java with those options. You will be thrashing your memory with the -Xmn setting. AggressiveOpts is experimental and you probably shouldn't add it. ParallelGCThreads=2 is going to compensate for the -Xmn setting at the cost of performance. IncrementalDutyCycle will mess with the way garbage collection is done impacting performance again.
Best to just remove all that cruft and use the standard -Xmx and -Xms settings, it will make your life easier.
However the minecraft server is hard coded to look for and create the files in a subdirectory of where the .jar is run from. Have you tried moving the minecraft_server.jar to another location? Perhaps a deeper subdirectory /home/ben/mystuff/testing/minecraft for example or /usr/minecraft or even /var/minecraft.
How did you get the minecraft_server.jar? Did you download it from minecraft.net or did you use some sort of package?
You're also doing some very strange things to your java with those options. You will be thrashing your memory with the -Xmn setting. AggressiveOpts is experimental and you probably shouldn't add it. ParallelGCThreads=2 is going to compensate for the -Xmn setting at the cost of performance. IncrementalDutyCycle will mess with the way garbage collection is done impacting performance again.
Best to just remove all that cruft and use the standard -Xmx and -Xms settings, it will make your life easier.
#7
Posted 12 February 2011 - 07:34 AM
Ok. I will try moving the server JAR to a different folder. Also I downloaded the server straight from the minecraft website.
#8
Posted 12 February 2011 - 07:38 AM
I figured it out now. It appears that the permissions on the minecraft server folder were not allowing the server to write to it. doing a chmod 777 to the folder made it work like I wanted.
#9
Posted 12 February 2011 - 07:42 AM
Sweet catch on that super coffee Unix permissions can be a bear.
I don't think you'll need 777, check the user and group that the minecraft_server.jar is owned by, might only need a 760 or 770. If you're on the system with anybody else 777 means that they can mess with your stuff.
Check out
http://www.zzee.com/...rmissions.shtml
I don't think you'll need 777, check the user and group that the minecraft_server.jar is owned by, might only need a 760 or 770. If you're on the system with anybody else 777 means that they can mess with your stuff.
Check out
http://www.zzee.com/...rmissions.shtml
#10
Posted 12 February 2011 - 08:39 AM
rch said:
The files for the server have to be and will always be in the same folder as the JAR file. Move the JAR and subsequent server files to your preferred directory and adjust the code you use to start the server to match the new location of the JAR file.
sansavarous said:
Well it is possible to do some fancy redirecting of data with pipes and such.
However the minecraft server is hard coded to look for and create the files in a subdirectory of where the .jar is run from. Have you tried moving the minecraft_server.jar to another location? Perhaps a deeper subdirectory /home/ben/mystuff/testing/minecraft for example or /usr/minecraft or even /var/minecraft.
However the minecraft server is hard coded to look for and create the files in a subdirectory of where the .jar is run from. Have you tried moving the minecraft_server.jar to another location? Perhaps a deeper subdirectory /home/ben/mystuff/testing/minecraft for example or /usr/minecraft or even /var/minecraft.
It is way, way way way, way way way way way, easier than you guys are making it.
The server files will ALWAYS generate in the present working directory of the user. Thus, if your jar file is located in
/etc/this/is/a/poor/choice/of/dirs/minecraft_server.jar
but youre in your home dir:
# /home/user $ java -jar /etc/this/is/a/poor/choice/of/dirs/minecraft_server.jar
it will be created in /home/user
doesnt matter where the jar is located. it only matters where the actual java command is being executed. trust me.









