Solved Can't run server on Ubuntu 12.04 LTS

Discussion in 'Bukkit Help' started by MegaNarwhal, Oct 29, 2012.

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

    MegaNarwhal

    I recently installed Ubuntu on my new server build and installed Java 7 on it, but when I try to use the start script the terminal window opens and then quickly closes. Any ideas? The start script is the one provided by SimpleRestart. I am running on 12.04 LTS Desktop (I had no idea how to use the server version :p)

    EDIT: I am running on 64-bit Ubuntu and used this tutorial to install Java. I'm relatively new to Linux, so I don't really know what I'm doing half the time... :rolleyes:

    Bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  2. Offline

    lokpique

    Please don't bump so quickly.

    We need more info to help.

    - Where did you install the craftbukkit jar to?
    - Can you paste us your startup script?

    It sounds like it's just not starting up in the right folder.
     
    MegaNarwhal likes this.
  3. Offline

    Sushi

    1. Paste the output of these commands:
    whereis java
    java -version
    2. Paste your startup script.
    3. Paste the location of the craftbukkit jar relative to the startup script.
    4. What is the name of your craftbukkit jar?
    5. Try running the startup script from a terminal, and post the output of that.
     
    MegaNarwhal likes this.
  4. Offline

    MysteryManX

    Good man for using Linux :p
    Have you tired OpenJDK? And also following the instructions from the Wiki?
     
    MegaNarwhal likes this.
  5. Offline

    MegaNarwhal

    All right.
    whereis java outputs this:
    Code:
    java: /usr/bin/java /usr/bin/X11/java /usr/share/java /usr/share/man/man1/java.1.gz
    java -version outputs this:
    Code:
    java version "1.7.0_09"
    Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
    Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
    Here is my startup script:
    Code:
    #!/bin/sh
                BINDIR=$(dirname "$(readlink -fn "$0")")
                cd "\$BINDIR"
                while true
                do
                    java -Xincgc -Xmx4G -jar craftbukkit.jar -o true nogui --log-limit=50000000
                    echo "Press Ctrl+C to completely stop the server."
                    echo "Restarting in:"
                    for i in 3 2 1
                    do
                        echo "$i..."
                        sleep 1
                    done
                    echo "Restarting now!"
                done
    The craftbukkit.jar is in the same folder as the startup script, and is named "craftbukkit.jar"
    How exactly do I go about running it from Terminal? When I type the path to it (~/testserver/server.sh) it returns this:
    Code:
    /bin/sh^M: bad interpreter: No such file or directory
    I followed the instructions exactly from the wiki: I made the start script executable, but when I try to start it up from Terminal it gives me the error above.
     
  6. Offline

    sverre26

    What is the autorestart thing?
    I need it for windows
     
  7. Offline

    MegaNarwhal

    Kinda off topic, but here:
    Code:
    @ECHO OFF
    SET BINDIR=%~dp0
    CD /D "%BINDIR%"
    :start
    "%ProgramFiles%\Java\jre6\bin\java.exe" -Xmx1024M -Xincgc -jar craftbukkit.jar
    goto start
    I just got the SQL server all set up, just waiting to get Minecraft working to import my databases :)
     
  8. Offline

    Sushi

    Aha, that's the problem. Your script has DOS line endings (hint is the ^M). Try running dos2unix on the file.
     
    MegaNarwhal likes this.
  9. Offline

    MegaNarwhal

    Runs now :D However when I try to join the server from this computer, it gives me a connection refused: connect. Do I need to configure a firewall exception on the server? How do I do this?

    EDIT: I have opened the port with sudo ufw allow 25565, but it still doesn't let me join the server.

    EDIT: Got it to work. Do I need to have the port forwarded on my router for it to work? The server is on a wired connection.
     
  10. Offline

    Sushi

    If you're hosting the server from home and you the server is connected to the router, then yes.
     
Thread Status:
Not open for further replies.

Share This Page