Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Jar application on Startup

  1. #1
    Join Date
    Feb 2013
    Beans
    22

    Jar application on Startup

    Hi all,

    I am trying to figure out how can I add a jar program to startup. I've tried installed application to run on startup, it worked out fine, but my jar application would not appear on start up.


    Help please anyone.


    Thanks in advance!

    Fr: Ubuntu newbie

  2. #2
    Join Date
    Oct 2011
    Location
    ZZ9 Plural Z Alpha
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Jar application on Startup

    You may need to write a script that calls the jar-

    Code:
    java -jar /path/to/your/jar


    Save the script in ~/bin, and add the script to your startup programs.

  3. #3
    Join Date
    Feb 2013
    Beans
    22

    Re: Jar application on Startup

    Hi cortman,

    Thanks for the reply!
    This is what I am looking for, in addition I need to make the script executable from the terminal command, ~# chmod 777 /bin/<the script>.

    Thanks so much!


  4. #4
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Jar application on Startup

    The easiest way to run it would be to add it to the file /etc/rc.local.

    (Assuming the jar is in your home folder) Make a script like the following and save it in your home folder (let's call myapp.sh, for example):
    Code:
    #!/bin/sh
    java -jar /your_home_folder/your_app.jar [optional arg if any]
    Make it executable:
    Code:
    chmod u+x myapp.sh
    ./myapp.sh
    So now you'll have to open /etc/rc.local to add a call to your script. In order to do it just run the following:
    Code:
    gksudo geany /etc/rc.local
    (You'll have to use the text pad you have installed on your computer)

    And just before the line exit 0, add the the call to your script:
    Code:
    sh /your_home_folder/myapp.sh
    Last edited by slickymaster; March 5th, 2013 at 07:20 PM.

  5. #5
    Join Date
    Feb 2013
    Beans
    22

    Re: Jar application on Startup

    Hi slickymaster,

    Thanks for the reply.
    The first one worked, surely I will also try your solution.

    Thanks!

  6. #6
    Join Date
    Oct 2011
    Location
    ZZ9 Plural Z Alpha
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Jar application on Startup

    Glad it's working- please mark the thread [SOLVED].
    Good luck!

  7. #7
    Join Date
    Dec 2009
    Beans
    6,771

    Re: Jar application on Startup

    I guess it depends on what this jar file does but can't you just add it to your start up applications:

    Select the Dash thingy ( I'm a XFCE user sorry ) > Startup Applications > Add:
    Startup.png
    No need to make it executable.

  8. #8
    Join Date
    Feb 2013
    Beans
    22

    Re: Jar application on Startup

    Hi All,

    Thanks for your kindness.
    Is it also possible to add a script that when I close the application user will automatically be logged off from the system?

    Thanks so much!

    -IJ-

  9. #9
    Join Date
    Oct 2011
    Location
    ZZ9 Plural Z Alpha
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Jar application on Startup

    Quote Originally Posted by IJselflearner View Post
    Hi All,

    Thanks for your kindness.
    Is it also possible to add a script that when I close the application user will automatically be logged off from the system?

    Thanks so much!

    -IJ-
    It is possible, you'd have to run the script constantly, as a daemon. Here's maybe one idea.

  10. #10
    Join Date
    Feb 2013
    Beans
    22

    Re: Jar application on Startup

    Hi cortman,

    Thanks for the link.
    By the way, here's what i added in the script and it worked,

    gnome-session-quit --no-prompt

    what it does is to automatically sign off the user upon closing the application.

    Thanks so much.

Page 1 of 2 12 LastLast

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
  •