Start Java jar as Windows Service using SC.EXE
<p>I want to start a Minecraft Server as a Service in a Windows Server 2008 R2 machine.</p>

<p>This command line works fine:</p>

<pre><code>c:\Windows\System32\java.exe -cp c:\Data\minecraft-server\minecraft-server.jar com.mojang.minecraft.server.MinecraftServer -Xms512M -X mx512M
</code></pre>

<p>The I created a service using the following SC command:</p>

<pre><code>sc config MinecraftServer binPath= "c:\Windows\System32\java.exe -cp c:\Data\minecraft-server\minecraft-server.jar com.mojang.minecraft.server.MinecraftServer -Xms512M -Xmx512M"
</code></pre>

<p>The service is created and when I start the service Windows starts it but then it comes back with a message that says:</p>

<blockquote>
  <p>The service is not responding to the
  control function.</p>
</blockquote>

<p>The service does start but for some reason the command does not let the system know that it is started. </p>

<p>There is something simple that I've missed but I am not very experienced with Java so if anoyone here can give my guidance it would be very welcome!</p>
