You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, November 5th 2003, 4:33pm

Create Menu Item to run sh file

I have a file, called start.sh, which contains one line to start an application:
java -jar foo.jar

This file is located in /usr/local/Foo
In a terminal window, if I cd to /usr/local/Foo and type:
./start.sh
then the application starts, no problem

So now I want to create a Menu Item that runs this file, so I can start the application from the Menu.

When i created the new menu item, in the command text box, I navigated to the file, so that this appears:
/usr/local/argoUML/start.sh
but this does not work
What do I need to do?

seb

Professional

Posts: 622

Location: Sydney

Occupation: Student

  • Send private message

2

Thursday, November 6th 2003, 9:39am

Admittingly i have not tried this so no guarantees.

Right click on the kde menu button, and select menu-editor. Im not sure but i think this may be only mandrake.

Click new item
Type in the name, and type in the command. make sure you have the full path the the command.

With your problem, you seem to have selected

[code:1]/usr/local/argoUML/start.sh [/code:1]

should it not be

[code:1]/usr/local/Foo/start.sh [/code:1]

????

hth

Seb

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

3

Thursday, November 6th 2003, 1:38pm

Does it work from commandline if you use the full path while being in your home directory, i.e. witout cd'ing into the program directory first?

Cheers,
_
Qt/KDE Developer
Debian User

4

Thursday, November 6th 2003, 2:46pm

seb:
I made a mistake when i posted the problem.
The file is really located in /usr/local/argoUML/, not usr/local/Foo
I was just trying to make the problem more generic because i think that the fact that it is this particular application is irrelevant. So your reply was correct, but my post was wrong.

So to state it correctly, This file is located in /usr/local/argoUML
In a terminal window, if I cd to /usr/local/argoUML and type:
./start.sh
then the application starts, no problem when i created the new menu item, in the command text box, I navigated to the file, so that this appears:
/usr/local/argoUML/start.sh
but this does not work

anda_skoa:
no it doesn't. good point. here are the results from trying it from the top:

# /usr/local/argoUML/start.sh
Exception in thread "main" java.util.zip.ZipException: No such file or directory
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:112)
at java.util.jar.JarFile.<init>(JarFile.java:127)
at java.util.jar.JarFile.<init>(JarFile.java:65)
# /usr/local/argoUML/.start.sh
bash: /usr/local/argoUML/.start.sh: No such file or directory
# ./usr/local/argoUML/start.sh
bash: ./usr/local/argoUML/start.sh: No such file or directory

So, i guess i need to find the right syntax for the command when not in the same directory as the start.sh file

5

Thursday, November 6th 2003, 3:06pm

Quoted

Original von allelopath

anda_skoa:
no it doesn't. good point. here are the results from trying it from the top:

# /usr/local/argoUML/start.sh
Exception in thread "main" java.util.zip.ZipException: No such file or directory
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:112)
at java.util.jar.JarFile.<init>(JarFile.java:127)
at java.util.jar.JarFile.<init>(JarFile.java:65)
# /usr/local/argoUML/.start.sh
bash: /usr/local/argoUML/.start.sh: No such file or directory
# ./usr/local/argoUML/start.sh
bash: ./usr/local/argoUML/start.sh: No such file or directory

So, i guess i need to find the right syntax for the command when not in the same directory as the start.sh file

Have you tried setting the working directory in the menu entry
to /usr/local/argoUML ?

BTW: There is an extended version of argoUML from Gentleware
called Poseidon. They offer a community edition free of charge...

6

Thursday, November 6th 2003, 4:25pm

cmbofh:
yes, i did, no dice.
thanks for the tip on Poseidon, i'll look into it.

7

Thursday, November 6th 2003, 4:41pm

sometimes, i'm not very smart, but eventually the answer comes.

the answer is to put "java -jar /usr/local/argoUML/argouml.jar "
in the menu item command.

seb

Professional

Posts: 622

Location: Sydney

Occupation: Student

  • Send private message

8

Thursday, November 6th 2003, 9:19pm

Try setting the $PATH to include /usr/local/argoUML/.
Conversely you could try and put the script file in /usr/bin
and see if it works if you run "sh start.sh"

Good luck
seb

9

Friday, November 7th 2003, 2:25am

Thanks for everyone's input, its working now.

seb

Professional

Posts: 622

Location: Sydney

Occupation: Student

  • Send private message

10

Friday, November 7th 2003, 2:17pm

would you care to tell us what you did to fix the problem? That way we can help other people in the future with a more definitive solution :D.

Thx
Seb

11

Friday, November 7th 2003, 2:30pm

as i said previously:

the answer is to put "java -jar /usr/local/argoUML/argouml.jar "
in the menu item command.