Starting java app from desktop icon

Kevin Krammer kevin.krammer at gmx.at
Mon Nov 13 19:25:18 GMT 2006


On Monday 13 November 2006 19:39, Nigel Henry wrote:
> I have a Java app, "Breakage" a drum sequencer. To start it in Konsole,
> first I have to cd to Breakage-22b, which is the folder in /home/user
> containing the .jar file for the drum sequencer. So the procedure is.
>
> $ cd Breakage-22b
> Breakage-22b $ /usr/local/java/bin/java -jar Breakage2.jar
>
> This starts the java app ok, but is there a way to run this from a link to
> application on the desktop?
>
> It appears that cd'ing to the directory containing the .jar file is
> necessary before running the command /usr/local/java/bin/java -jar
> Breakage2.jar

When you create a "link to program" through the desktop's context menu, there 
is an option to set the application's working directory.
Try setting it to /home/user/Breakage-22b or whatever the correct directory is

If this doesn't work, you can create a small starter script and use it as the 
program instead. The script should look like this

#!/bin/sh
cd /home/user/Breakage-22b
/usr/local/bin/java -jar Breakage2.jar

It needs to be executable (executable flag set), but since you can specify the
full path when creating the link you can put it anywhere.

Cheers,
Kevin

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde/attachments/20061113/83016509/attachment.sig>
-------------- next part --------------
___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.


More information about the kde mailing list