Starting java app from desktop icon

Nigel Henry cave.dnb at tiscali.fr
Mon Nov 13 21:46:41 GMT 2006


On Monday 13 November 2006 21:19, Boyan Tabakov wrote:
> On 13.11.2006 21:25, Kevin Krammer wrote:
> > 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
>
> Hi,
> What Kevin wrote is actually the right way to do this with the application
> icon. I'd like just to add that if you need to cd in to the directory only
> to find the file you want to launch, you can launch it directly with this
> command:
> $ java -jar /path/to/file.jar
> This is of course if your application doesn't need something in it's
> current directory (like config files, data etc...)

Now that doesn't work for me, mind you Fedora is a bit funny about wanting 
full path names, also there are other files apart from the .jar that the app 
needs to use.
>
> && you asked for is a construction used in linux shells (sh, bash etc...)
> and means the following:
> Supposed we have 'command1 && command2'. This means execute command1. If
> command1 returns a non-error exit status (which is 0), then run command2.
> Do nothing otherwise.

Thanks for the explanation about "&&" . I'm learning all the time.

Nigel.
___________________________________________________
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