Description Usage Arguments Details Value See Also Examples
The getKotlinScriptEngineJars
function searches a directory recursively for ‘kotlin*.jar’ files required to create an instance of the Kotlin script engine. Because Kotlin does not provide a standalone script engine JAR file, we include this convenience function to simplify adding JAR files to the class path.
1 2 3 4 | getKotlinScriptEngineJars(
directory,
minimum = TRUE
)
|
directory |
A character vector of length one specifying a path that contains Kotlin script engine JAR files. |
minimum |
A logical vector of length one. When |
The function searches the given directory recursively. If one or more of the required JAR files are not found, the function throws an error with a message listing the required files.
As of this writing, a standalone Kotlin compiler installation does not contain all of the required files to create a script engine instance. See section “Script engine installation and instantiation” in the User Manual for more information.
A character vector containing paths to the JAR files.
1 2 3 4 5 6 7 8 | ## Not run:
library("jsr223")
jars <- getKotlinScriptEngineJars("~/my-path/kotlin")
engine <- ScriptEngine$new("kotlin", jars)
engine %~% "1 + 1"
engine$terminate()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.