Results 1 to 5 of 5

Thread: Why do some programs run incorrectly if run from a shortcut or dock/launcher?

  1. #1
    Join Date
    Aug 2006
    Beans
    Hidden!
    Distro
    Ubuntu Studio 12.10 Quantal Quetzal

    Why do some programs run incorrectly if run from a shortcut or dock/launcher?

    Can someone explain to me why the program WordBiz runs fine from the terminal but if launched from the side dock or a launcher icon on desktop, the program runs with no sound and no images?

    Program is in java from here - http://www.isc.ro/linux/download.html

    Command typed into terminal to run it is -
    java -jar wordbiz.jar

    ...and that works fine.

    But if I enter the same command into a launcher, the program runs but with no images or sound.


    Why is this?
    Have you got nothing better to do? Do you enjoy clicking links? Then try this.

  2. #2
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,452
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Why do some programs run incorrectly if run from a shortcut or dock/launcher?

    Quote Originally Posted by blackdalek View Post
    Can someone explain to me why the program WordBiz runs fine from the terminal but if launched from the side dock or a launcher icon on desktop, the program runs with no sound and no images?
    ......
    Why is this?
    Because a user shell is a different environment from a launcher icon.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate.
    New to technical forums?: How To Ask Questions The Smart Way

  3. #3
    Join Date
    Aug 2006
    Beans
    Hidden!
    Distro
    Ubuntu Studio 12.10 Quantal Quetzal

    Re: Why do some programs run incorrectly if run from a shortcut or dock/launcher?

    ok... is there any way to create a launcher for this game which will result in the game running correctly? Or do I have to manually start it through a command line every time?
    Have you got nothing better to do? Do you enjoy clicking links? Then try this.

  4. #4
    Join Date
    Aug 2006
    Beans
    Hidden!
    Distro
    Ubuntu Studio 12.10 Quantal Quetzal

    Re: Why do some programs run incorrectly if run from a shortcut or dock/launcher?

    I've come up with a sort of solution. The problem with the launcher seems to stem from the fact that the java app must be run from the directory where the app is located.

    Learned about making bash scripts (never touched them before). Made a script thus -
    Code:
    #!/bin/bash
    cd /home/dalek/WordBiz
    java -jar wordbiz.jar
    and saved as wordbiz.sh on the desktop

    Now I can click this and the game will run properly, however it isn't perfect as I get a "Do you want to run "WordBiz.sh", or display its contents?" prompt every time.

    So if someone can tell me how to bypass the prompt that would be cool.
    Have you got nothing better to do? Do you enjoy clicking links? Then try this.

  5. #5
    Join Date
    Oct 2009
    Location
    Elgin, IL USA
    Beans
    2,325
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Why do some programs run incorrectly if run from a shortcut or dock/launcher?

    Launchers often have trouble with parameters, so try sh -c and enclosing the rest in single quotes:
    Code:
    sh -c 'java -jar wordbiz.jar'
    However, depending where wordbiz.jar is, you likely need to provide a path to it.

    For example I use this in a launcher for minecraft (launched in a terminal and that launches the gui):
    Code:
    sh -c 'java -Xmx2G -Xms1G -cp ~/MC-client/minecraft.jar net.minecraft.LauncherFrame'
    Last edited by efflandt; January 8th, 2013 at 08:16 AM.
    i5 650 3.2 GHz, 8 GB, nvidia GTX 550 Ti @ 1080p (year old GT 430 began freezing) and assorted other computers

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •