I'm picky and anything I can run as a service makes me happier. It works great on Windows Server 2008 x64. Having Minecraft run as a service makes it easier to manage disaster recovery. If the service crashers and you have recovery options restart it on crash through the service properties window, it will turn it back on. I haven't tested this yet but we'll see when it crashes.
THIS POST IS OUTDATED, but there are several other solutions below this post that may work better for you.
Install Summary
- Download yajsw and extract to any folder.
- Open task manager and find the "java" pid under processes. This is most likely your minecraft server.
- Open a command prompt and browse to the "bat" folder under yajsw. (ex. D:\yajsw-beta-10.3\bat).
- Run genConfig.bat (ex. genConfig.bat 2467).
wrapper.conf
- Browse to "conf" folder (ex. D:\yajsw-beta-10.3\conf) and open wrapper.conf in a text editor.
- Set the working directory to your minecraft .jar server file. (ex. \minecraftserver\ for D:\minecraftserver\).
- Uncomment wrapper.app.password and enter your admin account password. Make sure the username on the line above is correct.
- Fill in service name and descriptions.
Create/Install Service
- Run installService.bat from the bat directory. (ex. D:\yajsw-beta-10.3\bat)
- Open Services Manager through administration tools.
- Right click the server, properties.
- Browse to "Log On" tab.
- Change to "This Account" and use the same account in your wrapper.conf.
I apologize in advance if this post is necrothreadic. I couldn't find any updated information when I was looking a few days ago.
MrJangles, thank you so much for providing the basic process; you're brilliant! Once I got it to work, I re-wrote part of the instructions in my blog for clarity and to add information on getting the hey0 mod running on a minecraft server running as a windows service. If anyone else if struggling, my notes might help:
I've been wanting to do this as the first step to making further automation to my server.
A few notes of things that slowed me down:
1- make sure to go to "File > View" to find the Process ID for the server
2- as a best practice, create a service account for the server to run under; that way the password to your admin account is not in clear text
3- when attempting to run the "create service.bat", I received the following error:
Quote from My Error Message »
"error during install 123
The filename, directory name, or volume label syntax is incorrect.
Service c:/Program Files (x86)/Java/jre6/bin/javaw.exe NOT installed
Press any key to continue...
The Reason? I'd left the service name commented out! Aargh! took forever to find that.
So finally the service is created. But attempting to connect to it from localhost, I see in the game:
Quote from my game »
Failed to connect to the server
Connection Refused: Connect
So, I opened firewall ports for UDP & TCP Just to be sure on 25565 (Matches my server.properties file). Didn't fix the problem...
If it seems like people want it I'll continue development on my service wrapper application. This app is quick and simple and doesn't require any other installs or java configs. Here's a shot:
Sorry to reply to this old thread - but this is the most relevant information that popped up while searching for a solution... so I'll pile on.
I looked at the various solutions but wasn't happy with the Java based solution and I wanted something trivially configurable but provided the configuration parameters to set security as I deemed fit. I ended up rolling a native C++ solution hosting a Java host which is drag/drop installable and .INI configurable.
Only just seen this thread, my free program "Yet Another Minecraft Server" is very stable and does all this with a simple install, as well as providing a web interface so you can still control your server. Check it out at http://yams.in/. Includes port forwarding, firewall opening, dynamic DNS and is open source.
I'm picky and anything I can run as a service makes me happier. It works great on Windows Server 2008 x64. Having Minecraft run as a service makes it easier to manage disaster recovery. If the service crashers and you have recovery options restart it on crash through the service properties window, it will turn it back on. I haven't tested this yet but we'll see when it crashes.
THIS POST IS OUTDATED, but there are several other solutions below this post that may work better for you.
Install Summary
- Download yajsw and extract to any folder.
- Open task manager and find the "java" pid under processes. This is most likely your minecraft server.
- Open a command prompt and browse to the "bat" folder under yajsw. (ex. D:\yajsw-beta-10.3\bat).
- Run genConfig.bat (ex. genConfig.bat 2467).
wrapper.conf
- Browse to "conf" folder (ex. D:\yajsw-beta-10.3\conf) and open wrapper.conf in a text editor.
- Set the working directory to your minecraft .jar server file. (ex. \minecraftserver\ for D:\minecraftserver\).
- Uncomment wrapper.app.password and enter your admin account password. Make sure the username on the line above is correct.
- Fill in service name and descriptions.
Create/Install Service
- Run installService.bat from the bat directory. (ex. D:\yajsw-beta-10.3\bat)
- Open Services Manager through administration tools.
- Right click the server, properties.
- Browse to "Log On" tab.
- Change to "This Account" and use the same account in your wrapper.conf.
Start the service.
Download and Documentation: http://yajsw.sourceforge.net/
Enjoy!
http://www.minecraftaddicts.com
http://minecraftforu...?f=1014&t=40524
MrJangles, thank you so much for providing the basic process; you're brilliant! Once I got it to work, I re-wrote part of the instructions in my blog for clarity and to add information on getting the hey0 mod running on a minecraft server running as a windows service. If anyone else if struggling, my notes might help:
(yet another) Installing minecraft server as a windows service:
http://windowsmasher.wordpress.com/2010 ... ft-server/
Installing the Hey0 minecraft server mod as a windows service:
http://windowsmasher.wordpress.com/2010 ... erver-mod/
Thanks again!
A few notes of things that slowed me down:
1- make sure to go to "File > View" to find the Process ID for the server
2- as a best practice, create a service account for the server to run under; that way the password to your admin account is not in clear text
3- when attempting to run the "create service.bat", I received the following error:
The Reason? I'd left the service name commented out! Aargh! took forever to find that.
So finally the service is created. But attempting to connect to it from localhost, I see in the game:
So, I opened firewall ports for UDP & TCP Just to be sure on 25565 (Matches my server.properties file). Didn't fix the problem...
Coffee Break time to sit & think.
INFO|wrapper|11-02-25 03:26:33|Win service: before service init
INFO|wrapper|11-02-25 03:26:33|starting Process
INFO|wrapper|11-02-25 03:26:33|Controller State: UNKNOWN -> WAITING
INFO|wrapper|11-02-25 03:26:33|+ ServiceMain callback
INFO|wrapper|11-02-25 03:26:33|reporting status 0
INFO|wrapper|11-02-25 03:26:33|reporting status 0
INFO|wrapper|11-02-25 03:26:33|onstart
INFO|wrapper|11-02-25 03:26:33|working dir C:\Mineserver
INFO|wrapper|11-02-25 03:26:33|found script scripts/trayMessage.gv
INFO|wrapper|11-02-25 03:26:33|started process with pid 6660
INFO|wrapper|11-02-25 03:26:34|set state STARTING->RUNNING
INFO|6660/0|11-02-25 03:26:34|external stop false
INFO|6660/0|11-02-25 03:26:34|25.02.2011 3:26:34 org.apache.commons.vfs.VfsLog info
INFO|6660/0|11-02-25 03:26:34|no java main method found -> aborting
INFO|6660/0|11-02-25 03:26:34|INFO: Using "C:\Windows\TEMP\vfs_cache" as temporary files store.
INFO|6660/0|11-02-25 03:26:34|java.io.FileNotFoundException: C:\MineServer (Access Denied)
INFO|wrapper|11-02-25 03:26:34|Trigger found: Exception
INFO|6660/0|11-02-25 03:26:34| at java.util.zip.ZipFile.open(Native Method)
INFO|wrapper|11-02-25 03:26:34|start script scripts/trayMessage.gv
INFO|6660/0|11-02-25 03:26:34| at java.util.zip.ZipFile.<init>(Unknown Source)
INFO|6660/0|11-02-25 03:26:34| at java.util.jar.JarFile.<init>(Unknown Source)
INFO|6660/0|11-02-25 03:26:34| at java.util.jar.JarFile.<init>(Unknown Source)
INFO|6660/0|11-02-25 03:26:34| at org.rzo.yajsw.app.WrapperManagerImpl.loadJar(WrapperManagerImpl.java:366)
INFO|6660/0|11-02-25 03:26:34| at org.rzo.yajsw.app.WrapperManagerImpl.init(WrapperManagerImpl.java:221)
INFO|6660/0|11-02-25 03:26:34| at org.rzo.yajsw.app.WrapperManagerProxy.getWrapperManager(WrapperManagerProxy.java:52)
INFO|6660/0|11-02-25 03:26:34| at org.rzo.yajsw.app.AbstractWrapperJVMMain$1.run(AbstractWrapperJVMMain.java:31)
INFO|6660/0|11-02-25 03:26:34| at java.security.AccessController.doPrivileged(Native Method)
INFO|6660/0|11-02-25 03:26:34| at org.rzo.yajsw.app.AbstractWrapperJVMMain.preExecute(AbstractWrapperJVMMain.java:27)
INFO|6660/0|11-02-25 03:26:34| at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:34)
INFO|wrapper|11-02-25 03:26:34|end script scripts/trayMessage.gv
INFO|6660/0|11-02-25 03:26:34|Controller State: WAITING -> PROCESS_KILLED
Read only is disabled, account have full access, folder security settings also configured.
I'm running into the same problem when following the directions in the first post. I'm running WIndows Server 2003 with the latest Java installed.
If it seems like people want it I'll continue development on my service wrapper application. This app is quick and simple and doesn't require any other installs or java configs. Here's a shot:
I looked at the various solutions but wasn't happy with the Java based solution and I wanted something trivially configurable but provided the configuration parameters to set security as I deemed fit. I ended up rolling a native C++ solution hosting a Java host which is drag/drop installable and .INI configurable.
http://minecraft.woodruffs.org/javasvc-1-0-0-1-released/
does it also work with bukkit? Or only vanilla?