I am using the beanshell interpreter to read a file with code in it to be executed. I assumed that the default directory for file browsing would be the same as it is for the rest of the sketch, however when i run my sketch i get a file not found exception when i use this file path:
And i get this as my error telling me that it is actually looking in /Applications/code/default-methods/ for exit.java:
java.io.FileNotFoundException: /Applications/code/default-methods/exit.java (No such file or directory)
and if i use
i then see this:
java.io.FileNotFoundException: /code/default-methods/exit.java (No such file or directory)
does anyone know why the default directory for file browsing when calling source on the bsh interpreter object would be /Applications/code/ and not /data/code but when i use proxml to save xml files i use ./xml/accounts/accounts.xml to save a file where /code/ and /xml/ are in the same folder, that the default directory is the sketchs data folder?
proxml, as the name implies, is made for Processing and aware of its paths. BeanShell is a pure Java library, not related to Processing, so it defaults to default user/system paths. You can use the usual path facilities provided by Processing, like sketchPath(relativePath) or dataPath(relativePath).