"Runtime" debugging Bukkit Plugins in Eclipse

Discussion in 'Resources' started by Blockhaus2000, Feb 27, 2014.

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

    Blockhaus2000

    Do you ever have seen the video of Notch on YouTube where he uses runtime debugging? Did you ever wish that something like that is possible for Bukkit plugins? So now, here is an instruction for it!

    Requirements:
    • You have to have Linux or anything else where you have a bash
    • You have to have "screen" installed. If you haven't installed it yet, use "apt-get install screen" to install it.
    1. Right-Click on you project and select New -> File. Name the new file "start.sh", then open it in the Eclipse texteditor (by puttin it the file in the editor window) and then paste the following code there:
    2. Right-Click on your project and select New -> File. Name the new file "build.sh", the open it in the Eclipse texteditor (by putting it in the editor window) and paste the code of the script at the bottom there (select the script that it for you).
    3. Right-Click you project and select New -> Folder. Name the new folder "dist".
    4. Place the "craftbukkit.jar" in the "dist"- folder.
    5. Click on your project then select (in the menu bar) Run -> External Tools -> External Tools Configurations
    6. Right-Click on project and select New
    7. As "Location", use "/bin/bash"
    8. As "Working Directory", click on Browser Workspace, click on the arrow at the left side of your project and select your "dist" folder. Then click OK.
    9. As "Arguments", copy the value of "Working Directory" and replace "/dist" to "/start.sh"
    10. Click on "Run". You will get a message in the Eclipse console and a terminal will appear immediately. Wait for the Bukkit server for generating and preparing the world. Then you can connect to your Bukkit server through Minecraft with the IP "localhost". Type "stop" to stop your Bukkit server.
    11. Right-Click your project and select Properties (or open throw Alt + Enter)
    12. Click on Builders.
    13. Click on New
    14. Select Program and click OK
    15. As "Location", use "/bin/bash".
    16. As "Working Directory", click on Browser Workspace, select your project and click OK.
    17. As "Arguments", copy the value of "Working Directory" and add "/start.sh" at the end (but before "}").
    18. Click on Build Options and check "Durong auto builds" if not checked
    19. Click OK
    20. Click on your builder und move it up until it is the second one after the Java Builder.
    21. Click OK
    22. Select you project and the check (in the menu bar) Project -> Build Atomatically if not checked.
    23. To start you server, click on the arrow with the red basket on top of the project explorer.
    If you change something on you code now, your server will reload and the new code is in use immediately.

    NOTE: If you start the server again, the "old" server will stop and a "new" server will start.

    NOTE: To disable runtime debugging (because it costs a lot of resources), right-click your project, select builders and uncheck you created builder.


    Have fun and program efficient with runtime debugging,
    Blockhaus2000

    PS: If you have trouble, please create a comment.


    Scripts:
    • Use "maven-test.txt" if you use maven and you want to include your test classes.
    • Use "maven.txt" if you use maven and you don't want to include your test classes.
    • Use "normal.txt" if you don't use maven.
     

    Attached Files:

  2. Offline

    Blockhaus2000

Thread Status:
Not open for further replies.

Share This Page