Jump to content

can not create a text file


JGhost

Recommended Posts

I'm getting this error when attempting to create a text file:

 

[ERROR][05/02 09:37:33 AM]: Uncaught exception!

java.security.AccessControlException: access denied ("java.io.FilePermission" "C:\Users\John\Desktop\Area\Area661830290.txt" "write")

 

My script was working fine yesterday. The only things that have changed was updating from...

jdk1.8.0_65 to jre1.8.0_91 

and

OSBot 2.4.53 to OSBot 2.4.58

 

now my script create a text file in a directory that it has many times before.

 

does anyone know how I can fix this?

Link to comment
Share on other sites

File myFile = new File(System.getProperty("user.home")  + "/OSBot/Data/JGhost/Area/Area661830290.txt"

 

Even better!

 

In case I needed to share my script, it wouldn't adapt well the way I current have it; using absolute path. Using System.getProperty would definitely work a lot better. Thanks for sharing

Edited by JGhost
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...