Results 1 to 7 of 7

Thread: [Solved] Xfce launcher will not run .sh script

  1. #1
    Join Date
    Dec 2012
    Beans
    5

    [Solved] Xfce launcher will not run .sh script

    So I've been trying to get a game to run from it's .sh script that starts when I click on a launcher. The game is PokeMMO and the .sh script for it runs fine, if I run it in terminal from that folder. If I create a launcher in the panel of my desktop and try it the terminal flashes once and closes or says:
    Code:
    /home/andrew/Downloads/PokeMMO-Client/PokeMMO.sh: 2: java: not found
    And the launcher has this for the command:
    Code:
    xfce4-terminal -H --command="/home/andrew/Downloads/PokeMMO-Client/PokeMMO.sh"
    I'm on xubuntu 11.10 with xfce (lastest .v I belive). Not sure what other info I should add so yeah.
    Last edited by cj360; March 19th, 2013 at 11:21 PM.

  2. #2
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Xfce launcher will not run .sh script

    Try to change the current working directory to the directory where the script is located before you run it.
    Code:
    cd /home/andrew/Downloads/PokeMMO-Client/ && ./PokeMMO.sh

  3. #3
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Xfce launcher will not run .sh script

    When you launch the terminal with a command, ~/.bashrc doesn't get executed. This means that any changes to the environment you put there (PATH, CLASSPATH, JAVA_HOME) won't be carried over to the script.

  4. #4
    Join Date
    Dec 2012
    Beans
    5

    Re: Xfce launcher will not run .sh script

    After trying sisco's advice I get a
    Code:
    Failed to execute command "cd /home/andrew/Downloads/PokeMMO-Client/ && ./PokeMMO.sh".
    Same thing if I try just point to the script with .[path-to script]

    And schragge, since I have
    Code:
    # Java PATHs
    export JAVA_HOME=/opt/java/64/jdk1.6.0_34
    export PATH=$PATH:$JAVA_HOME/bin
    
    # Android tools
    export PATH=${PATH}:~/android-sdk/tools
    export PATH=${PATH}:~/android-sdk/platform-tools
    export PATH=${PATH}:~/bin
    In my bashrc I need to re-decalre the java paths in the launcher?


    Edit- I tried adding a plain path to the script in the launcher and terminal flashes open for a second and then immedatly closes. But the script is fine when I run it in terminal from the pokemmo folder in thunar and terminal.
    Last edited by cj360; March 17th, 2013 at 03:06 AM.

  5. #5
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Xfce launcher will not run .sh script

    xfce4-terminal has an option --working-directory. You can try
    Code:
    xfce4-terminal --working-directory=/home/andrew/Downloads/PokeMMO-Client -Hc '/home/andrew/Downloads/PokeMMO-Client/PokeMMO.sh'
    As for your paths from ~/.bashrc, try to copy those lines to ~/.xsessionrc (create the file if it doesn't exist). You need to re-login for the change to take effect.
    Last edited by schragge; March 19th, 2013 at 02:28 PM.

  6. #6
    Join Date
    Dec 2012
    Beans
    5

    Re: Xfce launcher will not run .sh script

    Same reaction, I see terminal open for a second and it immediately closes. Even after adding the lines to my new ~.xsessionrc and rebooting.

  7. #7
    Join Date
    Dec 2012
    Beans
    5

    Re: Xfce launcher will not run .sh script

    Edit- fixed it! Instead of using the .sh script I just pasted the contents of it into the launcher and it's working directory into the working directory box obviously:

    Code:
     command: java -Xmx512M -ea -Xbootclasspath/p:./libs/jsr166.jar -cp ./lib/*:PokeMMO.exe com.pokeemu.client.Client
    working directory: /home/andrew/Downloads/PokeMMO-Client/
    Thanks to the people above that helped and replied!
    Last edited by cj360; March 19th, 2013 at 11:20 PM. Reason: fixed it, yay!

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
  •