Forum Discussion

R_Schaaf's avatar
R_Schaaf
Copper Contributor
Feb 19, 2022

More granular support for Controlled folder access for java applications

I'm using Controlled Folder access in Win10 to limit which apps can access the file system.

The problem is however that when trying to add access to a java application, it adds access to the java.exe itself and not to the jar file that is run using java.
For instance, I do want Maven to be able to access my files, because it needs to access pom.xml files and such, but I don't want my minecraft server with 3rd party plugins to access my protected files, because it doesn't need access to anything other than the folder it is running in and it is preferrable not to give too much access to these 3rd party plugins.

My suggestion is to add more granularity and give folder access on an executable jar/main class basis, rather than to the whole java.exe.
This would also fix having to give permission again whenever Java updates.

So java -jar spigot.jar and java org.codehaus.classworlds.Launcher (maven) would have different listings on the "Allow an app through Controlled folder access" page..

  • Reza_Ameri's avatar
    Reza_Ameri
    Silver Contributor
    Java is using Java Virtual Machine and the way it behave is different with other Windows application and this scenario is by design. I advise you to open start and search for feedback and open the Feedback Hub app and report this issue and make sure share steps to reproduce the problem.

Resources