I have a .jar that I run frequently, and I'd like to pin it to the taskbar. I've tried pinning the .jar itself, and I've tried pinning a .bat file that has the command to run the .jar, but it doesn't work either. Is there a way to accomplish this?
6 Answers
Similar to MJH's answer, but instead of cmd.exe, you could specify the following path to the executable to avoid having the Command Prompt showing up:
javaw.exe -jar "C:\path\to\your\executable.jar"
If you are the developer of the Java project, you might want to see my answer on StackOverflow as to getting it to play nicely with Windows 7.
- 4,256
Create shortcut for cmd.exe
Right click the shortcut and select properties.
In the box for Target, go to the end of
%SystemRoot%\system32\cmd.exe.After that Target, type a SPACE and then
/C, another SPACE and the path to the .jar file.Pin the shortcut to the taskbar.
You can also change the Icon or click the General tab and change the name of the shortcut if you wish.
- 57,881
- 515
as this answer says, you should only type in your target properties of your shortcut:
explorer "path_of_jar_file"
just this!
So, I solved this without needing to involve command prompt and the extra window. Basically you just create a shortcut to the .jar and then edit the path with a link to windows explorer in front. Windows explorer will almost always be on your C drive
The .jar i'm linking to is ripme
Here's what it looks like on my spare D drive. The line below is exactly as it appears in my shortcut.
C:\Windows\explorer.exe D:\ripme.jar
Here's what it looks like if i wanted to have the .jar on my c drive
C:\Windows\explorer.exe C:\Users\R\Documents\ripme.jar
screenshot example enter image description here
The aplication will launch as usual and you'll be able to pin the shortcut to the taskbar and change the icon as you please. Hope this helps!
- 1
For those having issues with the CMD window remaining open, you can do exactly like MJH described, but instead of /C try /C START and then the path to your jar file.
With MJH solution you can opt to run the cmd minimized instead of normal window to avoid having to close the window