Skip to content

abeshenov/kotlin-scripting-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kotlin JSR 223 Scripting Demo

This is an example of calling Kotlin from Java via the scripting API (JSR 223: Scripting for the Java Platform).

The dependencies are:

  • org.jetbrains.kotlin:kotlin-scripting-jsr223:1.7.22
  • org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.22

I used to have some issues with configuring the scripting engine, possibly due to following old APIs or having wrong dependencies. I share this tiny example with a working setup.

To try this in Docker:

sudo docker image build -t kotlin-jsr223-demo .
sudo docker run --rm kotlin-jsr223-demo

About

Minimal example of JSR-223 scripting with Kotlin

Topics

Resources

Stars

Watchers

Forks