Struggling to create a desktop shortcut for a jar file.
Found a solution which created a .url file aka
[InternetShortcut]
URL=D:/test.jar
which worked pretty well. But then the stakes went higher and now i need to run in from a certain JRE. Basically, what i'w tried, was to fix the URL to %javapath%/java.exe -jre d:/test.jar, but Win7 started to treat it as a web-url, adding a "http://" at the start of the url when looking through file properties.
Is there a way to make this work? Or maybe a freeware library that can create urls in a more graceful way?
Upd: Finally struck on an answer(and yes, i found in on stockoverflow) - Creating a shortcut file from Java
If someone gets here, looking for the answer:
ShellLink sl = ShellLink.createLink("C:/Program Files (x86)/Java/jre1.8.0_121/bin/javaw.exe");
sl.setCMDArgs("-jar D:/Test1.jar");