[Tool] Start your development server with ease (Windows)

Discussion in 'Resources' started by Jake6177, Oct 25, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Jake6177

    [[ Sorry if this is the wrong forum ]]

    I made a batch file for Windows computers that allows you to open a single batch session and keep it open whilst you program your plugin. It was getting tedious for me to close and re-open it every time I had to stop the server to replace the JAR.

    Here's the code:
    Code:
    echo off
     
    REM ##############################################################
    REM # Welcome to easy development server starter                                                                              #
    REM # Written by Jake6177 for usage on Windows machines                                                            #
    REM ##############################################################
     
    REM >> Set variables >> NO SPACES, this is critical. Type the string as a complete whole.
     
    set memory=-Xmx1024M
    set filename=editme.jar
    set jexec=java
     
    REM >> if JAVA fails to start, change the jexec to the full path including quotes; e.g. set jexec="C:\Program Files\Java\jre7\bin\java.exe"
    REM >> DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING!
     
    :start
    echo Welcome, %USERNAME%!
    echo Choose a function to perform:
    echo.
    echo 1. Run server
    echo 2. Exit
    echo.
     
    set /p choice="Enter your choice: "
    if "%choice%"=="1" goto run
    if "%choice%"=="2" goto exit
    cls
    goto start
     
    :run
    cls
    %jexec% %memory% -jar %filename% -o true
    cls
    goto start
     
    :exit
    exit
    
    Notice: Bukkit's forums don't allow the @ in the code, so add @ to the front of echo.

    Put this code into your run.bat file or similar and then run it like normal. Edit the variables to make them work how you need them to. Enter "1" to start the server or "2" to exit. The reason this is easier is because when you "stop" command the server, it notices the java instance has stopped and takes you back to the start menu where you can enter "1" or "2" again.

    Enjoy!
     
  2. Offline

    Ronbo

    Um I don't know about you but I'm able to simply copy-paste the plugin and replace it while my server is still running and just use /reload.
     
    mrsamcraft likes this.
  3. Offline

    TechGuard

    Even better, I directly export and overwrite the plugin. Don't even need to copy-paste. :)
     
    Ultimate_n00b likes this.
  4. Offline

    Ronbo

    wow, epic derp on my part. Thanks for reminding me that I can do that lol.
     
  5. Offline

    Jake6177

    Yeah, the way I have my projects set up (multiple drives), I can't do that. So this was my solution.
     
  6. Offline

    SacredWaste

    I honestly see no point in this.
     
  7. Offline

    Jake6177

    Sorry to disappoint you, your highness. I really don't care if you think it's useful or not, I use it to my advantage and if others can find a use out of it as well, then good. Thanks for your comment.
     
  8. Offline

    Staartvin

    I find it very useful. Thanks! :)
     
  9. Offline

    SacredWaste

    Jake6177 It was only my opinion. I don't see how this is different from just setting it up normally, as that can be editted.
     
  10. Offline

    Ultimate_n00b

    I find this useful in certain situations. Thanks.
     
  11. Offline

    Jake6177

    SacredWaste Opinions are fine, but you could give more criticism than "I honestly see no point in this." - pretty dumb.

    Glad some find it useful.
     
Thread Status:
Not open for further replies.

Share This Page