Results 1 to 7 of 7

Thread: [SOLVED] Menu Shortcut - Application in Terminal

  1. #1
    Join Date
    Oct 2008
    Location
    Brighton, UK
    Beans
    12
    Distro
    Ubuntu 9.10 Karmic Koala

    [SOLVED] Menu Shortcut - Application in Terminal

    Hello,
    n00b here. Right first of all thank you to the Ubuntu community for making this possible. Just switched from windzzzzzz and can't believe it took me so long to ditch the lame OS. I like Ubuntu, I like the open source philosophy, I like the forums, I like the tongue-in-cheeckness of it all as opposed to the tedious smuttering of corporate sobriety of Macs and Windzz. So, well done and thanks again for making this possible.

    Now my question:

    I am trying to make a menu shortcut to run a program. The program is javaFIBS and it needs java to run. For the program to run correctly I have to type

    java -jar JavaFIBS-1.0.11_JDK13.jar

    but the program only runs correctly if I open terminal within the javafibs directory (or go there before I run java).
    So what I am trying to do is have my Application in terminal to run two commands:

    1. cd /home/pietro/JavaFIBS2001/
    2. java -jar JavaFIBS-1.0.11_JDK13.jar

    I tried

    java -jar /home/pietro/JavaFIBS2001/JavaFIBS-1.0.11_JDK13.jar

    but it does not seem to work as javaFIBS does not know where to look for its files and lots of buttons do not get loaded up. As in, the program run, but not correctly.

    Any help would be greatly appreciated.

    oh.. I was also wondering if there is an appropriate directory where to store software. In windzzz used to be Program Files, in Ubuntu I am using /home/pietro but I am not sure this is the appropriate one. Any suggestion?

    Thank you for your help

    p.

  2. #2
    Join Date
    Jul 2007
    Location
    Ohio, US
    Beans
    287
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Menu Shortcut - Application in Terminal

    I cannot answer most of your queries, but regarding storing/installing software, the ideal place specifically meant for all software manually installed by you is /usr/local/
    Maverick Thinkpad T61, Intel GMA X3100, Intel WiFi 4965AG.

  3. #3
    Join Date
    Mar 2006
    Location
    Devon UK
    Beans
    419

    Re: Menu Shortcut - Application in Terminal

    try saving the following as a script and then run the script, (don't forget to set the executable bit right click on the script select properties and check the box)
    Code:
    #!/bin/bash
    cd /home/pietro/JavaFIBS2001/
    java -jar JavaFIBS-1.0.11_JDK13.ja
    In /dev/null no one can hear the kernel panic!
    Don't EVER use sudo rm -rf / . if you don't understand a command check it out first!
    BACK UP YOUR DATA OR YOU WILL LOSE IT!!
    Supergrub - The best thing since sliced bread www.supergrubdisk.org

  4. #4
    Join Date
    Oct 2008
    Location
    Brighton, UK
    Beans
    12
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Menu Shortcut - Application in Terminal

    Quote Originally Posted by Keith Hedger View Post
    try saving the following as a script and then run the script, (don't forget to set the executable bit right click on the script select properties and check the box)
    Code:
    #!/bin/bash
    cd /home/pietro/JavaFIBS2001/
    java -jar JavaFIBS-1.0.11_JDK13.ja
    Perfect! Thank you so much Keith. Just to understand better what's the "#!/bin/bash" line all about?



    Quote Originally Posted by sancho panza View Post
    I cannot answer most of your queries, but regarding storing/installing software, the ideal place specifically meant for all software manually installed by you is /usr/local/
    Thanks Sancho. I tried to copy and paste there but no luck.. I seem to have no permission of doing anything in there??? Do I have to do it through terminal?

  5. #5
    Join Date
    Mar 2006
    Location
    Devon UK
    Beans
    419

    Re: Menu Shortcut - Application in Terminal

    the #! at the front of a script tells the system to run the script using a specific shell in this case 'BASH' there are other ones you can use ie #!/bin/sh, #!/bin/python (I think!).
    Different shells have slightly different capabilities, the #! MUST be the first line of the script and no leading spaces/tabs.
    In /dev/null no one can hear the kernel panic!
    Don't EVER use sudo rm -rf / . if you don't understand a command check it out first!
    BACK UP YOUR DATA OR YOU WILL LOSE IT!!
    Supergrub - The best thing since sliced bread www.supergrubdisk.org

  6. #6
    Join Date
    Mar 2006
    Location
    Devon UK
    Beans
    419

    Re: Menu Shortcut - Application in Terminal

    Quote Originally Posted by uppercrustie View Post
    I tried to copy and paste there but no luck.. I seem to have no permission of doing anything in there??? Do I have to do it through terminal?
    Yes you need root permissions to alter anything in the /usr directory open a terminal and type (for instance )
    Code:
    sudo cp /path/to/script /usr/local/bin
    Please check the man pages for any command you don't fully understand as you can damage your system with the wrong commands being run with root permissions.
    In /dev/null no one can hear the kernel panic!
    Don't EVER use sudo rm -rf / . if you don't understand a command check it out first!
    BACK UP YOUR DATA OR YOU WILL LOSE IT!!
    Supergrub - The best thing since sliced bread www.supergrubdisk.org

  7. #7
    Join Date
    Oct 2008
    Location
    Brighton, UK
    Beans
    12
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Menu Shortcut - Application in Terminal

    Brilliant! All solved. TY K.

Tags for this Thread

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
  •