Hi I have created executable jar of my java program i want to create shortcut icon for that jar. Means may be my jar is in any other memory location of hard drive(eg- D or E
I'm not entirely sure about this answer, but I've recently found this:
try {
Files.createLink(FileSystems.getDefault().getPath("C:/Documents and Settings/MyUser/Desktop", "MyLink.lnk")
, FileSystems.getDefault().getPath("C:/Documents and Settings/MyUser/Desktop", "MyExistingFile.pdf"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
This example create a link (shortcut) in the desktop to another file in the desktop.
it in deed creates a shortcut recognized by the OS, but I have not been able to make it work in Windows systems (the shortcut is been created and it is recognized by Windows but it does not work), but I'm working on it, so as soon as I get the answer I'll post it here, in the meantime, you may try to help me, lets see who is the first to make it work :D!
Greetings!