Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to run a minecraft server from a "" script. So far I have this:

java -Xms512M -Xmx2048M -jar minecraft_server.jar nogui

I'm running the script from the same directory as the minecraft_server.jar, and it does nothing. I want it to open a terminal window that is running the java program. I am new to Linux so I'm sure I'm doing something stupid, any help would be appreciated.

share|improve this question
What does it mean that it doesn't do anything? As I understand it, you're specifically asking it not to display anything, but only run silently in the background. – Jo-Erlend Schinstad Dec 30 '11 at 0:04
If I am I'm not trying to, what I want it to do is open a terminal window running the server. – lcolinl Dec 30 '11 at 0:31
What happens when you run the script from the command line? – Taymon Dec 30 '11 at 1:55
Can you please try the following and report the output which java to see if the java paths are being picked. Also it could be running as a daemon so can you please try ps -ef | grep java to see if it is running as a background process. Finally, can your please run cd <directory you are running from>; fuser . to see if there are multiple processes started from that directory. – First Zero Dec 30 '11 at 6:59
up vote 1 down vote accepted

If the problem is that running the script doesn't show a terminal window, the solution depends on the window manager you're using. Gnome as well as KDE allow to edit properties of desktop shortcuts on a right-click and setting a option like "run in terminal" there.

Another way is to edit the desktop configuration file manually: you can find them in the Desktop subdirectory of your home dir. Just add a line with Terminal=true to the desktop configuration file that should run the server.

share|improve this answer
It works, thank you! When I double click the bash file it opens a window with some options, one is "run in terminal", I could of sworn I tried this earlier and it didn't work but it does now so thats good. Also, is there any way to make it automatically do this? I am using the default gnome in 11.1 btw. – lcolinl Dec 30 '11 at 20:26
ah - ok, you didn't create a desktop shortcut yet? I think this is the easiest way. Just right-click on the desktop, select create starter or something like that, and enter the path to the bash script. Among the properties of the shortcut, there's something like run in terminal. – tohuwawohu Dec 30 '11 at 21:44

Why are you using echo? That just prints the rest of the line as a sequence of literals to the terminal.

share|improve this answer
Changed it. I had it without echo originally, but it doesn't work either, so I was just trying stuff. – lcolinl Dec 29 '11 at 23:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.