Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.
Fun, engaging games to boost memory, math fluency, typing speed, and English skills—perfect for learners of all ages.
Java's integration of scripting languages enhances dynamic behavior in applications, enabling real-time script execution, modification of application logic, and support for user-defined logic. This chapter explores the Java Scripting API and its practical applications, primarily focusing on the Nashorn JavaScript engine. It also discusses the advantages and challenges of scripting in Java, alongside alternatives to Nashorn and embedding Groovy as a scripting language.
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
References
Chapter_29_Intro.pdfClass Notes
Memorization
What we have learnt
Final Test
Revision Tests
Term: Java Scripting API (JSR 223)
Definition: A set of interfaces that allow Java applications to embed and execute scripts written in dynamic programming languages.
Term: Nashorn
Definition: A JavaScript engine introduced in Java 8, providing improved performance and integration with Java, but deprecated in Java 11.
Term: Bindings
Definition: A map of key-value pairs used to pass variables between Java and scripting contexts.
Term: Invocable Interface
Definition: An interface that allows calling JavaScript functions from Java code within the Nashorn engine.
Term: GraalVM
Definition: A high-performance runtime that provides support for multiple languages including JavaScript and Python, serving as a modern alternative to Nashorn.
Term: Groovy
Definition: A dynamic language for the Java platform, which integrates seamlessly with Java and can be embedded as a scripting language.