You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't get this to work in Windows 11, sadly. Here's how I got it to work instead:
I found a program that can set file associations here (I found a scoop manifest for it here). But it needs a ProgId to be passed as the file type association, so I modified your batch file to a registry file like so:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\.jar]
@="scoop-javaw"
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw]
@="Java Archive"
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\DefaultIcon]
@="C:\\Users\\<username-goes-here>\\scoop\\apps\\openjdk\\current\\bin\\javaw.exe,1"
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\shell]
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\shell\open]
[HKEY_CURRENT_USER\Software\Classes\scoop-javaw\shell\open\command]
@="\"C:\\Users\\<username-goes-here>\\scoop\\apps\\openjdk\\current\\bin\\javaw.exe\" -jar \"%1\""
Unfortunately, I couldn't get %JAVA_HOME% to work in the registry, so the full path had to be used (replace the two <username-goes-here> with your username/scoop path if on another drive).
Once you've saved this as a .reg file and run it, then finally you can use SetUserFTA:
> SetUserFTA .jar scoop-javaw
The file association should work immediately. But for the DefaultIcon to show up you might need to restart File Explorer. Hope this helps someone.
Edited 05/09/2022 to fix reg file not adding paths to registry (needed to escape each \ and ")
Running executable JARs requires calling
java.exe -jar "%1"
, but when selecting the java.exe in explorer, it usesjava.exe "%1"
, which fails.i suggest adding something like:
manifests:
/scripts/associate-javaw.bat:
The text was updated successfully, but these errors were encountered: