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.
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.
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.
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.
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.
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.
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.
Quote from sansavarous »
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.
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
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
Are the files showing up in your /blah..blah/home/yournamehere directory or are they in /blah..blah/home/yournamehere/minecraft directory?
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.
w: minecraft.cm | e: [email protected] | t: @minecraft_cm | reviews
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.
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.
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/solutions/unix-permissions.shtml
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
but youre in your home dir:
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.