I am trying to create a file in a folder but I am getting exception as
java.security.AccessControlException:Access denied
Please try adding
<jre location>\lib\security\java.policy
grant { permission java.security.AllPermission; };
And check if it allows you. If allowed then you will have to add more permissions.
Further Readings:
Java 8 Documentation for java.policy files
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html