SlideShare a Scribd company logo
NASHORN
JavaScripting in Java8
Presentation by,
Hina Firdaus
M.tech(CSE)
2nd
Semester Guided by,
Dr. Syed Imtiyaz Hassan
Assistant Professor
SEST
Index
What is Nashorn?
Why is Nashorn?
Features of Nashorn.
Shortcomings of Nashorn.
Jjs.
Summary.
What is Nashorn?
 Nashorn is replacement introduced with Java 8 for the old, slow
Rhino JavaScript engine.
 It is based on the Da Vinci Machine (JSR 292/javax.script) and has
been released with Java 8
 The project aim will be to allow embedding JavaScript in Java
applications via JSR-223 and to develop standalone JavaScript
applications.
 Nashorn comprises of an embedded JavaScript interpreter and a
command line tool.
Nashorn, pronounced
"nass-horn," is German
for "rhinoceros," and it's
one of the animal names
for a German tank
destroyer used in World
War II.
Why Nashorn?
 Nashorn scripts do not need to be compiled. Nashorn fully supports
ECMAScript 5.1 specification along with some extensions, to 100% pure Java
implementation and 100% complied to bytecode and not the interpreted
mode as with Rhino.
 Nashorn provides much better performance than Rhino engine.
 It directly compiles the JavaScript code in-memory and passes the Java
bytecode to the JVM, and uses invokedynamic which provides backward
compatibility to JDK7.
 Nashorn provides a flexibility to the users that they can either
programmatically use it from Java programs or they can utilize it from the
command line tool “jjs” which is located in “$JAVA_HOME/bin” directory.
 It provides much faster execution and multi-threading of JavaScript while
running in Java’s JRE.
 Nashron can help in executing the OS level commands very easily.
 So far no security risk or exposure has been identified with Nashorn.
Features of Nashorn.
 Interoperable:
 Nashorn provides interoperability between the Java and
JavaScript i.e., Java code can call JavaScript code, and vice
versa.
 Embeddable:
 It’s very easy to use Nashorn to extend your Java applications
with JavaScript code as there are no third party libraries required
to add on.
 Compatible
 The goal pursued by the Nashorn team is not to provide a fast
JavaScript implementation for a specific browser - it’s to provide
a very fast implementation for server-side JavaScript
applications and scripts embedded in Java applications.
Continue…
 Performant
 Nashorn uses the invokedynamic JVM instruction to implement
all of its invocations. That is a major component of the
comparative improvement of performance and memory usage
regarding Mozilla Rhino.
 Shell Scripting
 Nashorn provides several built-in functions to exit the script, print
and read lines from standard output and input, read files, load
scripts, and bind properties of objects.
 JavaFX
 User can write JavaFX applications entirely in JavaScript using
Nashorn.
Shortcomings of Nashorn.
 Nashorn will only support ECMAScript-262 Edition 5.1. It will not
support any features of Edition 6 or any nonstandard features
provided by other JavaScript implementations.
 Nashorn will not include a browser plug-in API.
 Nashorn will not include support for DOM/CSS or any related
libraries (such as jQuery, Prototype, or Dojo).
 Nashorn will not include direct debugging support.
jjs
 For Nashorn engine, JAVA 8 introduces a new command line tool, jjs to
execute java script code at console.
 Steps to create and execute jjs script:
Step 1: Interpreting js file.
Step 2: jjs in interactive mode
Step 3: pass arguments
Step 4: Calling JavaScript in JAVA
Using ScriptEngineManager, JavaScript code can be called and interpretted in java.
Step 5: Verify the result.
Step 6: Calling Java from JavaScript
Summary
 Project Nashorn has enhanced the original JDK 6 Rhino
implementation by greatly improving performance for longer running
applications, for example when used inside a web server.
 It provides a timely update of performance and capabilities of the
co-bundled JavaScript engine.

More Related Content

What's hot

Migrating to Java 11
Migrating to Java 11Migrating to Java 11
Migrating to Java 11
Arto Santala
 
Devoxx17 - Préparez-vous à la modularité selon Java 9
Devoxx17 - Préparez-vous à la modularité selon Java 9Devoxx17 - Préparez-vous à la modularité selon Java 9
Devoxx17 - Préparez-vous à la modularité selon Java 9
Alexis Hassler
 
Docker - Dicas ninjas - MolaTech Talks
Docker - Dicas ninjas -  MolaTech TalksDocker - Dicas ninjas -  MolaTech Talks
Docker - Dicas ninjas - MolaTech Talks
matheuscmpm
 
[113] lessons from realm
[113] lessons from realm[113] lessons from realm
[113] lessons from realm
NAVER D2
 
Migration Spring Boot PetClinic REST to Quarkus 1.2.0
Migration Spring Boot PetClinic REST to Quarkus 1.2.0Migration Spring Boot PetClinic REST to Quarkus 1.2.0
Migration Spring Boot PetClinic REST to Quarkus 1.2.0
Jonathan Vila
 
Docker Swarm scheduling in 1.12
Docker Swarm scheduling in 1.12Docker Swarm scheduling in 1.12
Docker Swarm scheduling in 1.12
Atharva Chauthaiwale
 
DevNexus 2019: Migrating to Java 11
DevNexus 2019: Migrating to Java 11DevNexus 2019: Migrating to Java 11
DevNexus 2019: Migrating to Java 11
DaliaAboSheasha
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programming
business Corporate
 
Blog ingles pdf.1
Blog ingles pdf.1Blog ingles pdf.1
Blog ingles pdf.1
negroronny
 
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriThe Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
Docker, Inc.
 
Play framework
Play frameworkPlay framework
Play framework
sambaochung
 
Evolution of java
Evolution of javaEvolution of java
Evolution of java
sanjeevonline
 
Real World Android Akka
Real World Android AkkaReal World Android Akka
Real World Android Akka
Taisuke Oe
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache MesosCI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
Carlos Sanchez
 
Java Class1
Java Class1Java Class1
Java Class1
Mayank Aggarwal
 
Jsep
JsepJsep
Jsep
jpecliw
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
Ryan Cuprak
 
From Monolith to Docker Distributed Applications
From Monolith to Docker Distributed ApplicationsFrom Monolith to Docker Distributed Applications
From Monolith to Docker Distributed Applications
Carlos Sanchez
 
COBOL deployment to .NET or JVM
COBOL deployment to .NET or JVMCOBOL deployment to .NET or JVM
COBOL deployment to .NET or JVM
Micro Focus
 
Raising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code QualityRaising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code Quality
Thomas Moulard
 

What's hot (20)

Migrating to Java 11
Migrating to Java 11Migrating to Java 11
Migrating to Java 11
 
Devoxx17 - Préparez-vous à la modularité selon Java 9
Devoxx17 - Préparez-vous à la modularité selon Java 9Devoxx17 - Préparez-vous à la modularité selon Java 9
Devoxx17 - Préparez-vous à la modularité selon Java 9
 
Docker - Dicas ninjas - MolaTech Talks
Docker - Dicas ninjas -  MolaTech TalksDocker - Dicas ninjas -  MolaTech Talks
Docker - Dicas ninjas - MolaTech Talks
 
[113] lessons from realm
[113] lessons from realm[113] lessons from realm
[113] lessons from realm
 
Migration Spring Boot PetClinic REST to Quarkus 1.2.0
Migration Spring Boot PetClinic REST to Quarkus 1.2.0Migration Spring Boot PetClinic REST to Quarkus 1.2.0
Migration Spring Boot PetClinic REST to Quarkus 1.2.0
 
Docker Swarm scheduling in 1.12
Docker Swarm scheduling in 1.12Docker Swarm scheduling in 1.12
Docker Swarm scheduling in 1.12
 
DevNexus 2019: Migrating to Java 11
DevNexus 2019: Migrating to Java 11DevNexus 2019: Migrating to Java 11
DevNexus 2019: Migrating to Java 11
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programming
 
Blog ingles pdf.1
Blog ingles pdf.1Blog ingles pdf.1
Blog ingles pdf.1
 
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriThe Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
 
Play framework
Play frameworkPlay framework
Play framework
 
Evolution of java
Evolution of javaEvolution of java
Evolution of java
 
Real World Android Akka
Real World Android AkkaReal World Android Akka
Real World Android Akka
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache MesosCI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
 
Java Class1
Java Class1Java Class1
Java Class1
 
Jsep
JsepJsep
Jsep
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
 
From Monolith to Docker Distributed Applications
From Monolith to Docker Distributed ApplicationsFrom Monolith to Docker Distributed Applications
From Monolith to Docker Distributed Applications
 
COBOL deployment to .NET or JVM
COBOL deployment to .NET or JVMCOBOL deployment to .NET or JVM
COBOL deployment to .NET or JVM
 
Raising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code QualityRaising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code Quality
 

Similar to Nashorn

TechSearchWeb.pdf
TechSearchWeb.pdfTechSearchWeb.pdf
TechSearchWeb.pdf
TechSearchWeb
 
Technology Tutorial.pdf
Technology Tutorial.pdfTechnology Tutorial.pdf
Technology Tutorial.pdf
TechSearchWeb
 
TechSearchWeb Tutorials.pdf
TechSearchWeb Tutorials.pdfTechSearchWeb Tutorials.pdf
TechSearchWeb Tutorials.pdf
TechSearchWeb
 
Unit-IV_Introduction to Java.pdf
Unit-IV_Introduction to Java.pdfUnit-IV_Introduction to Java.pdf
Java Programming
Java ProgrammingJava Programming
Java Programming
Prof. Dr. K. Adisesha
 
Java ms harsha
Java ms harshaJava ms harsha
Java ms harsha
Harsha Batra
 
Introduction to Java Programming.pdf
Introduction to Java Programming.pdfIntroduction to Java Programming.pdf
Introduction to Java Programming.pdf
AdiseshaK
 
Sybsc cs sem 3 core java
Sybsc cs sem 3 core javaSybsc cs sem 3 core java
Sybsc cs sem 3 core java
WE-IT TUTORIALS
 
Netbeans
NetbeansNetbeans
Netbeans
acosdt
 
Java course-in-mumbai
Java course-in-mumbaiJava course-in-mumbai
Java course-in-mumbai
Unmesh Baile
 
Professional-core-java-training
Professional-core-java-trainingProfessional-core-java-training
Professional-core-java-training
Vibrant Technologies & Computers
 
The Brainify App - JavaFx
The Brainify App - JavaFxThe Brainify App - JavaFx
The Brainify App - JavaFx
Mohd Shamweel
 
java new technology
java new technologyjava new technology
java new technology
chavdagirimal
 
Java1
Java1Java1
Java
Java Java
Object Oriented Programming-JAVA
Object Oriented Programming-JAVAObject Oriented Programming-JAVA
Object Oriented Programming-JAVA
Home
 
Presentation on Java Basic
Presentation on Java BasicPresentation on Java Basic
Presentation on Java Basic
Rustamji Institute of Technology
 
JAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptxJAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptx
DrPreethiD1
 
Java Introduction | PDF
Java Introduction |  PDFJava Introduction |  PDF
Java Introduction | PDF
Geekster
 
Introduction to java programming tutorial
Introduction to java programming   tutorialIntroduction to java programming   tutorial
Introduction to java programming tutorial
jackschitze
 

Similar to Nashorn (20)

TechSearchWeb.pdf
TechSearchWeb.pdfTechSearchWeb.pdf
TechSearchWeb.pdf
 
Technology Tutorial.pdf
Technology Tutorial.pdfTechnology Tutorial.pdf
Technology Tutorial.pdf
 
TechSearchWeb Tutorials.pdf
TechSearchWeb Tutorials.pdfTechSearchWeb Tutorials.pdf
TechSearchWeb Tutorials.pdf
 
Unit-IV_Introduction to Java.pdf
Unit-IV_Introduction to Java.pdfUnit-IV_Introduction to Java.pdf
Unit-IV_Introduction to Java.pdf
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Java ms harsha
Java ms harshaJava ms harsha
Java ms harsha
 
Introduction to Java Programming.pdf
Introduction to Java Programming.pdfIntroduction to Java Programming.pdf
Introduction to Java Programming.pdf
 
Sybsc cs sem 3 core java
Sybsc cs sem 3 core javaSybsc cs sem 3 core java
Sybsc cs sem 3 core java
 
Netbeans
NetbeansNetbeans
Netbeans
 
Java course-in-mumbai
Java course-in-mumbaiJava course-in-mumbai
Java course-in-mumbai
 
Professional-core-java-training
Professional-core-java-trainingProfessional-core-java-training
Professional-core-java-training
 
The Brainify App - JavaFx
The Brainify App - JavaFxThe Brainify App - JavaFx
The Brainify App - JavaFx
 
java new technology
java new technologyjava new technology
java new technology
 
Java1
Java1Java1
Java1
 
Java
Java Java
Java
 
Object Oriented Programming-JAVA
Object Oriented Programming-JAVAObject Oriented Programming-JAVA
Object Oriented Programming-JAVA
 
Presentation on Java Basic
Presentation on Java BasicPresentation on Java Basic
Presentation on Java Basic
 
JAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptxJAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptx
 
Java Introduction | PDF
Java Introduction |  PDFJava Introduction |  PDF
Java Introduction | PDF
 
Introduction to java programming tutorial
Introduction to java programming   tutorialIntroduction to java programming   tutorial
Introduction to java programming tutorial
 

Recently uploaded

UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 

Recently uploaded (20)

UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 

Nashorn

  • 1. NASHORN JavaScripting in Java8 Presentation by, Hina Firdaus M.tech(CSE) 2nd Semester Guided by, Dr. Syed Imtiyaz Hassan Assistant Professor SEST
  • 2. Index What is Nashorn? Why is Nashorn? Features of Nashorn. Shortcomings of Nashorn. Jjs. Summary.
  • 3.
  • 4. What is Nashorn?  Nashorn is replacement introduced with Java 8 for the old, slow Rhino JavaScript engine.  It is based on the Da Vinci Machine (JSR 292/javax.script) and has been released with Java 8  The project aim will be to allow embedding JavaScript in Java applications via JSR-223 and to develop standalone JavaScript applications.  Nashorn comprises of an embedded JavaScript interpreter and a command line tool. Nashorn, pronounced "nass-horn," is German for "rhinoceros," and it's one of the animal names for a German tank destroyer used in World War II.
  • 5.
  • 6. Why Nashorn?  Nashorn scripts do not need to be compiled. Nashorn fully supports ECMAScript 5.1 specification along with some extensions, to 100% pure Java implementation and 100% complied to bytecode and not the interpreted mode as with Rhino.  Nashorn provides much better performance than Rhino engine.  It directly compiles the JavaScript code in-memory and passes the Java bytecode to the JVM, and uses invokedynamic which provides backward compatibility to JDK7.  Nashorn provides a flexibility to the users that they can either programmatically use it from Java programs or they can utilize it from the command line tool “jjs” which is located in “$JAVA_HOME/bin” directory.  It provides much faster execution and multi-threading of JavaScript while running in Java’s JRE.  Nashron can help in executing the OS level commands very easily.  So far no security risk or exposure has been identified with Nashorn.
  • 7. Features of Nashorn.  Interoperable:  Nashorn provides interoperability between the Java and JavaScript i.e., Java code can call JavaScript code, and vice versa.  Embeddable:  It’s very easy to use Nashorn to extend your Java applications with JavaScript code as there are no third party libraries required to add on.  Compatible  The goal pursued by the Nashorn team is not to provide a fast JavaScript implementation for a specific browser - it’s to provide a very fast implementation for server-side JavaScript applications and scripts embedded in Java applications.
  • 8. Continue…  Performant  Nashorn uses the invokedynamic JVM instruction to implement all of its invocations. That is a major component of the comparative improvement of performance and memory usage regarding Mozilla Rhino.  Shell Scripting  Nashorn provides several built-in functions to exit the script, print and read lines from standard output and input, read files, load scripts, and bind properties of objects.  JavaFX  User can write JavaFX applications entirely in JavaScript using Nashorn.
  • 9. Shortcomings of Nashorn.  Nashorn will only support ECMAScript-262 Edition 5.1. It will not support any features of Edition 6 or any nonstandard features provided by other JavaScript implementations.  Nashorn will not include a browser plug-in API.  Nashorn will not include support for DOM/CSS or any related libraries (such as jQuery, Prototype, or Dojo).  Nashorn will not include direct debugging support.
  • 10. jjs  For Nashorn engine, JAVA 8 introduces a new command line tool, jjs to execute java script code at console.  Steps to create and execute jjs script: Step 1: Interpreting js file. Step 2: jjs in interactive mode Step 3: pass arguments Step 4: Calling JavaScript in JAVA Using ScriptEngineManager, JavaScript code can be called and interpretted in java. Step 5: Verify the result. Step 6: Calling Java from JavaScript
  • 11. Summary  Project Nashorn has enhanced the original JDK 6 Rhino implementation by greatly improving performance for longer running applications, for example when used inside a web server.  It provides a timely update of performance and capabilities of the co-bundled JavaScript engine.