Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Run Minecraft Server as a Service


  • Please log in to reply
15 replies to this topic

#1

MrJangles
  • Location: Toronto
  • Minecraft: MrJangles

Posted 26 September 2010 - 03:34 AM

Posted Image

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
Minecraft Addicts - Longest running server with the highest recorded up time.

Register or log in to remove.

#2

jpuskar
    jpuskar

    Out of the Water

  • Members
  • 2 posts

Posted 05 December 2010 - 03:08 AM

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:

(yet another) Installing minecraft server as a windows service:
http://windowsmasher... ... ft-server/

Installing the Hey0 minecraft server mod as a windows service:
http://windowsmasher... ... erver-mod/

Thanks again!

#3

schmeckendeugler

Posted 27 December 2010 - 08:35 PM

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:

My Error Message said:

"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:

my game said:

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...

Coffee Break time to sit & think. :)

#4

GregRUS
    GregRUS

    Newly Spawned

  • Members
  • 1 posts

Posted 25 February 2011 - 12:29 AM

I've got really annoying error on Windows Server 2008 R2 (x64) and Windows 7 (x64)
Spoiler:

Read only is disabled, account have full access, folder security settings also configured.

#5

Mithrodin

Posted 01 March 2011 - 02:01 PM

I got everything running, but when I start the service, it will automatically stop after a while. Is this normal, or am I doing something wrong?

#6

earthcrafter

Posted 23 March 2011 - 09:09 PM

fails at the genCOnfig.bat [Pid] step for me:

Quote

creating java configuration file
ERROR: no classpath found -> abort


#7

swphreak
    swphreak

    Newly Spawned

  • Members
  • 1 posts

Posted 10 May 2011 - 05:17 PM

earthcrafter said:

fails at the genCOnfig.bat [Pid] step for me:

Quote

creating java configuration file
ERROR: no classpath found -> abort

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.

#8

ekilnams
    ekilnams

    Newly Spawned

  • Members
  • 1 posts

Posted 13 May 2011 - 07:47 PM

swphreak said:

earthcrafter said:

fails at the genCOnfig.bat [Pid] step for me:

Quote

creating java configuration file
ERROR: no classpath found -> abort

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.

Hi guys, that's an easy fix. You need to define a CLASSPATH environment variable so java knows where to look for the minecraft server class files.

The steps are as follows:
1. Open the System Properties panel through Control Panel.
2. Open the Advanced tab.
3. Select Environment Variables.
4. Under the User Variables box select New.
5. In the window that pops up enter:

Variable name: CLASSPATH
Variable value: \minecraft_server.jar (ex. C:\Program Files\Minecraft\minecraft_server.jar)

6. Click OK through all the open windows to update your changes.
7. Log out of Windows and log back in again.
8. Run genConfig.bat again and it should work.

Hope that's helpful.

#9

Corefracture

Posted 10 August 2011 - 01:14 PM

Hi all,

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:
Posted Image

#10

Minotaurus0

Posted 14 August 2011 - 03:56 PM

Cool. How long you will take for completing this? :)

#11

TerhX
    TerhX

    Newly Spawned

  • Members
  • 1 posts

Posted 03 November 2011 - 08:21 PM

hey i need help to install i use Win7 and my server says
[WARNING] Can't keep up! Did the system time change, or is the server overloaded?
all time
help me
Skype: ETF-FIN
XFire: TerhX

#12

B33bl3bl0x

Posted 25 November 2011 - 06:11 PM

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.

http://minecraft.woo...0-0-1-released/

#13

bigolslabomeat

Posted 21 January 2012 - 03:48 PM

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.
Yet Another Minecraft Server: http://yams.in
Easiest way to run a Minecraft server on Windows!

#14

Jimmy341
    Jimmy341

    Out of the Water

  • Members
  • 5 posts
  • Location: Australia!
  • Minecraft: Jamesz341

Posted 21 January 2012 - 04:14 PM

:D  Well done on a simple way to do this!

Posted Image


#15

Optiknerve
  • Location: Jacksonville NC
  • Minecraft: Optiknerve
  • Xbox:optiknerve rc

Posted 26 April 2012 - 03:46 PM

View Postbigolslabomeat, on 21 January 2012 - 03:48 PM, said:

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.

does it also work with bukkit? Or only vanilla?
http://<script type="text/javascript" src="http://theresistance...t.js"></script>

#16

bigolslabomeat

Posted 26 April 2012 - 03:48 PM

View PostOptiknerve, on 26 April 2012 - 03:46 PM, said:

does it also work with bukkit? Or only vanilla?
Bukkit and the pre-release snapshots.

Bukkit Guide
Yet Another Minecraft Server: http://yams.in
Easiest way to run a Minecraft server on Windows!