Results 1 to 3 of 3

Thread: Shortcut to the file. Jar

  1. #1
    Join Date
    Apr 2009
    Posts
    67

    Shortcut to the file. Jar

    Hello,
    I created a java application that uses a configuration file in the same folder showing that it is jar file.

    I would like to create a shortcut on the desktop to my. jar, but the problem is that when I launch my application with the shortcut it states that it can not find the configuration file!

    when I right click on this file and create an shortcut on the desktop and try to access that file it deliver the message saying file not found.

    how to cure my problem please?

  2. #2
    Join Date
    Feb 2009
    Posts
    105

    Re: Shortcut to the file. Jar

    You may create a bash script to run the commands that will launch your application and link to the script for your shortcut. By way of illustration.

    Code:
    #!/bin/bash
    java -jar /full_path/paros.jar
    If you have not written bash script anytime then it would be written like this. Make sure that the you start on the first line, your first space should always starts with "#!/bin/bash". open a console and make do_paros executable by running following code:

    Code:
    $ chmod a+x do_paros
    And test the script from the command line to make sure it opens your application by running:

    Code:
    $ ./do_paros
    Once this has run then close the console and try running the script by double clicking on the do_paros file and see if it launches the application. If that works, create a shorcut to do_paros on your desktop and it should work fine.

  3. #3
    Join Date
    Feb 2009
    Posts
    78

    Re: Shortcut to the file. Jar

    A short cut is I believe just another file, so if you knew the format of this file you might be able to create one using Java. Without knowing the format you would probably need to use a Windows API to create it and that would require the use of JNI.

    There are lots of site on the internet where you could see that all the Windows specific features (creating shortcuts, registry entries, ect) are optional features, which means they most likely supply an exe or dll that they access using JNI.

Similar Threads

  1. Citrix app shortcut prompts to Download .ica file in Internet Explorer 9
    By Elias Blackman in forum Technology & Internet
    Replies: 1
    Last Post: 24-03-2012, 06:18 PM
  2. creating shortcut keys for a desktop shortcut
    By annroberti in forum Windows XP Support
    Replies: 6
    Last Post: 15-03-2012, 12:34 PM
  3. Unable to save paint file using shortcut keys in windows 7
    By Peasants in forum Operating Systems
    Replies: 5
    Last Post: 30-01-2010, 06:06 PM
  4. Shortcut broken after moving file
    By bonv in forum Vista Help
    Replies: 11
    Last Post: 07-10-2009, 06:13 AM
  5. Replies: 1
    Last Post: 24-03-2009, 09:30 PM

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
  •  
Page generated in 1,713,433,017.97950 seconds with 17 queries