I know how to manually associate a file type with a .jar file:
assoc .ext=filetype
ftype filetype="C:\Program Files\Java\jre6\bin\javaw.exe" -jar "path\to\jar\file\YourJarFile.jar" "%1"
I'm currently using Runtime.exec() to try to do these commands, but I'm getting Access is d开发者_C百科enied.
from the assoc command. I assume I need administrator privileges to run assoc, how can one do this from a java application?
try cmd /c assoc or such. It's an embedded command processor command
That should have connections with environnements context. try using the complete file path to assoc
精彩评论