Ecliipse Debugging - Console Input

Discussion in 'Plugin Development' started by Magik, Mar 18, 2011.

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

    Magik

    Does anyone know how to get console input working with eclipse debugging ever since the new bukkit console?
     
  2. Offline

    ArmEagle

    Ah, so it's not me that's messing something up?

    I've been at this for over an hour now, trying it to start the server in so many ways. But anything I enter in the eclipse console is completely ignored by the server. (Yet it worked just fine for running cmd.exe)

    This on Windows 7
    latest craftbukkit
    Eclipse: Version: Helios Service Release 2 Build id: 20110218-0911
     
  3. Offline

    nickguletskii

    What I do on Linux:
    Code:
    xterm -e java -jar craftbukkit.jar
    Add arguments, and you will be fine.
     
  4. Offline

    ArmEagle

    Thanks. I've tried to do similar things with cmd.exe on Windows. And your suggestion made me give it one more try. Though this doesn't solve the actual problem of using the eclipse console, at least you can give server commands now.

    Create a bat file (server.bat) with the following contents:
    Code:
    @ECHO OFF
    start cmd.exe /c "C:\Program Files\Java\jre6\bin\java.exe" -Xincgc -Xmx1G -jar D:\Games\Minecraft\CBserver\craftbukkit-0.0.1-SNAPSHOT.jar nogui
    
    (Obivously change the paths/files according to your own situation. Tbh, I have no idea what difference nogui makes here.)

    Then go to eclipse, 'Run' -> 'External Tools' -> 'External Tools Configurations':
    - Add a new Program entry.
    - Point the 'Location' to the bat file.
    - Set the 'Working Directory' to your server dir (containing the craftbukkit jar).
    - Go to the 'Common' tab and uncheck 'Allocate Console'.

    - Apply and Run!

    This opens the command console like it does normally.

    Edit:
    Changed the cmd.exe parameter /k to /c. This will close the console when the server stops running, instead of keeping it open.
     
  5. Offline

    nickguletskii

    Yeah, but I don't see a reason to use the eclipse console anyway...
     
  6. Offline

    ArmEagle

    Well, if it behaved slightly decently, I guess having the console in a set location on your screen could be handy for quick testing. The above usually opens the cmd.exe in some inconvenient location (stupid Windows and its lack of what it should be doing: window [geometry/position] management!).
     
Thread Status:
Not open for further replies.

Share This Page