...
Code Block | ||||
---|---|---|---|---|
| ||||
importClass(java.io.File); importClass(java.nio.charset.Charset); |
- Rhino and Nashorn:
Code Block | ||||
---|---|---|---|---|
| ||||
var imports = new JavaImporter( java.io.File, java.nio.charset.Charset ); |
Common Usage Example
Code Block | ||||
---|---|---|---|---|
| ||||
with (imports) { // usage of File // usage of Charset } |
...
- To make the changeover as smooth as possible, we recommend that users specify that the default JavaScript engine for the Java version is used, i.e. "
javax.script:ECMAscript
" instead of "javax.script:rhino"
. - This will ensure that the changeover of the JavaScript engine will occur at the same time as the changeover to Java 1.8.
- Please note that at the time of writing it is not yet decided when JobScheduler will become Java 1.8 capable but this is likely to occur towards the end of 2014. Oracle have announced that they will stop updating Java 7 after April 2015.
See also
- What Java scripting languages are supported?
- What are the differences between the SpiderMonkey, Rhino and Nashorn scripting engines?