0

I'm new on Ubuntu 14.04 LTS (64bit) and I'm just getting a hold of this new way of doing things.

I am using a program built for UNIX and I managed to install it and get it all work perfectly, but I am a little bit lazy so I'm trying to figure out a way to make an application shortcut just by double clicking on it (without using Teminal to go to the path and then typing the command for the program).

The command after I get into the right path:

java -cp jts.jar:total.2013.jar -Xmx512M -XX:MaxPermSize=128M jclient.LoginFrame .

Please try to make it as detailed as poosible because, as I said, I'm very new at this.

Dan
  • 6,753
  • 5
  • 26
  • 43
danp696
  • 33
  • 1
  • 6

1 Answers1

-1

Option 1: if the program shows an icon on left-side start bar when you open the program through terminal, then right click on that icon , and select " Lock to launcher" option.

Option 2: install GNOME Do. This little program shows up on login, and you type the name of any app that you wanna start.

Option 3: Classic menu. In software center download Classic Ubuntu Menu. It's an equivalent of start menu in Windows XP, and lists almost all programs you installed on Ubuntu.

Option 4 : Configure File Manager in Edit-> Properties -> Behavior to "Run executable text files when they are opened. " That way, you can make a scrip to open this program in xterm or another terminal emulator.

So having changed file manager behavior, create a new text file on desktop , and open with your favourite text editor. For me that's nano, so i would type in terminal:

nano ~/Desktop/Shortcut_Script.sh 

And in this script file put the following lines

#!/bin/bash

xterm -hold -e " /path/to/your/program/java -cp jts.jar:total.2013.jar -Xmx512M -XX:MaxPermSize=128M jclient.LoginFrame "

A small explanation here: this script basically calls xterm window, tells it to stay on (hold), and execute the commands enclosed by double quotes. From reading your question, I understand that you first need to navigate to the right folder, and then call the program, right ? So /path/to/your/program/ part should let you call that program in the right folder, while staying in the original start folder for xterm (which is your home/user folder). Now, if this does not work, and you do need to navigate to the folder, what you can do is this:

xterm -hold -e " cd /path/to/your/program/ ; java -cp jts.jar:total.2013.jar -Xmx512M -XX:MaxPermSize=128M jclient.LoginFrame "

Notice the semicolon. As you may know, it separates commands to bash. It will execute cd /path/to/your/folder first, and call the program second.

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
  • Please explain the down-vote ? – Sergiy Kolodyazhnyy Oct 08 '14 at 00:57
  • Thanks, the first option really helped me, but I tried all the first 3 of them just to learn. The fourth I need to work on. Thanks a lot – danp696 Oct 08 '14 at 01:33
  • Do you want me to add more explanation on the last option there ? It's fairly simple. – Sergiy Kolodyazhnyy Oct 08 '14 at 01:48
  • I added the explanation for that part anyway. May be useful for others who look through the question. In fact, this is a pretty decent way around of logout button decides to go missing ; i used the same way to make shutdown shortcut script for another question here on askubuntu – Sergiy Kolodyazhnyy Oct 08 '14 at 02:01