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.:crybaby:
how to cure my problem please?
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:
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.
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.