Not sure how java programming can be used to check the contents of your PC. Surely the OS has some tools for checking security.
Normally if I were to run an unknown jar file, I would use a permissions file:
A windows batch file
@Rem Test a jar file
java -Djava.security.manager -Djava.security.policy=mypolicy4RC.policy -jar RouteConverterCmdLine.jar
MORE
The mypolicy4RC.policy file:
grant {
permission java.util.logging.LoggingPermission "control";
permission java.lang.RuntimePermission "preferences";
};
These files are several years old and I don't remember what they are used for.