use beanshell to execute a scripts from a specific folder (error no such file or directory) -
i added library bsh android project (jar file), create file executor.bsh under scripts(a folder have created under project) used code below
private final interpreter i= new interpreter(); i.source("scripts/executor.bsh");
i got error:
no such file or directory
help !!
interpreter.source(..)
looks file, have jar entry. however, can still use with:
try (reader script = new inputstreamreader(getclass().getclassloader().getresourceasstream("scripts/executor.bsh")) { interpreter in = new interpreter(script, system.in, system.out, system.err, false); // script loaded // interpreter here. }
Comments
Post a Comment