2

My Minecraft server (Bukkit) .sh bash file is not opening! I did make it executable (in permissions, I clicked "anyone" for executable). Here's the code:

#!/bin/bash
cd "$( dirname "$0" )"
java -Xms1024M -Xmx1024M -jar craftbukkit.jar -o true

The server runs fine when I put the code in Terminal but not when it's in a .sh file.

I am using Lubuntu 12.10.

5
  • How are you trying to start it? What's the error message? Mar 10, 2013 at 12:44
  • I tried double clickin on it but dosent open any damn thing! i just copy pasted the code from bukkit wiki! Mar 10, 2013 at 12:47
  • Open a terminal and enter the `java -Xms…' command? Does it print out anything? If yes, please add it to your question.
    – qbi
    Mar 10, 2013 at 12:54
  • Again: What's the output if you run the script? Mar 10, 2013 at 14:16
  • What should be the path in .sh file if my server folder in in desktop? Mar 10, 2013 at 14:34

4 Answers 4

2

The script has to be in the same path then your craftbuckit.jar. Alternatively you could add the absolute path to the script:

#!/bin/bash
java -Xms1024M -Xmx1024M -jar /path/to/craftbukkit.jar -o true

Also you should execute the script in a terminal to be able to see the output. I think the minecraft server starts an admin console in the terminal. I don't know how it will behave if you don't run it in a terminal. At best you will have problems to gracefully stop the server later on and have no access to the admin console.

0

You have to open the .sh file in terminal, if you want to have the console. As far as I know, it'll open in the background as far as I know.

bukkit.sh should be in the same directory as the craftbukkit.jar file.

Press Ctrl-Alt-T and open the terminal, and do as follows:

cd /path/to/bukkit
./bukkit.sh

I sat with the same problem yesterday, and this worked for me. Another bonus could be, if the application opens in the background and crash, you're not going to see the output. I

In terminal (foreground) you will get any errormessage. (Please comment so, if an error should appear. I will respond to that too. Alternatively create a new question)

0

The script won't open a Terminal window by default. Put the Bukkit start script somewhere else (maybe in your Bukkit folder) then use this script on the desktop:

#!/bin/bash
gnome-terminal --command=~/path/to/start.sh
0

You just have to add <terminalname> -e in front of the line that runs the .jar file. (<terminalname> being the name of the terminal/console you're using e.g. gnome-terminal or konsole if you're using KDE. If -e doesn't work try --command=.

So if I were to run your code I would change it to (I'm usind KDE): #!/bin/bash cd "$( dirname "$0" )" konsole -e java -Xms1024M -Xmx1024M -jar craftbukkit.jar -o true

Also - as already mentioned - it's better to have the .sh script in the same folder as the .jar

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .