Download - Nashorn
![Page 1: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/1.jpg)
Nashorn in Java 8
Everett Toews
Developer Advocate
@everett_toews
AustinJUGApril 22, 2014 @ 7:00 pm
![Page 2: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/2.jpg)
What Is It?
![Page 3: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/3.jpg)
Nashorn
Embedded
JavaScript
Engine
![Page 4: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/4.jpg)
Nashorn
JavaScript 5.1
![Page 5: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/5.jpg)
Nashorn
JavaScript
to
Java Bytecode
![Page 6: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/6.jpg)
![Page 7: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/7.jpg)
Nashorn
2 x to 10x
Performance
Improvement
![Page 8: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/8.jpg)
Nashorn
JSR 292
“InvokeDynamic”
![Page 9: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/9.jpg)
Nashorn
Efficient method
invocation without
type information
![Page 10: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/10.jpg)
Nashorn
YADLOTJVM
![Page 11: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/11.jpg)
What Does It Compare To?
![Page 12: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/12.jpg)
Nashorn
V8
![Page 13: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/13.jpg)
Nashorn
Google Chrome
Node.js
![Page 14: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/14.jpg)
![Page 15: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/15.jpg)
What Can I Do With It?
![Page 16: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/16.jpg)
Nashorn
Shell Scripts
![Page 17: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/17.jpg)
Nashorn
Command-line
Tool
![Page 18: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/18.jpg)
Nashorn
Embedded
Interpreter
![Page 19: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/19.jpg)
Nashorn
Anything
Node.js Can Do?
![Page 20: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/20.jpg)
Nashorn
Avatar.js
![Page 21: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/21.jpg)
Nashorn
Node.js apps using
Java libraries
![Page 22: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/22.jpg)
Nashorn
Using legacy Java
code from Node.js
![Page 23: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/23.jpg)
How Do I Use It?
![Page 24: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/24.jpg)
Nashorn
export JAVA_HOME=
`/usr/libexec/java_home -v 1.8`
![Page 25: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/25.jpg)
Nashorn
export PATH=
$JAVA_HOME/bin:$PATH
![Page 26: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/26.jpg)
Nashorn
Interpreted
![Page 27: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/27.jpg)
Nashorn
Script
CLI
![Page 28: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/28.jpg)
Nashorn
Java
![Page 29: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/29.jpg)
Nashorn
Java Interop
![Page 30: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/30.jpg)
Where Did You Get This Information?
![Page 31: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/31.jpg)
Nashorn
infoq.com/articles/nashorn
![Page 32: Nashorn](https://reader035.vdocuments.us/reader035/viewer/2022062702/554bc6e9b4c9053a298b56fb/html5/thumbnails/32.jpg)
Thank You
developer.rackspace.com
Everett Toews
Developer Advocate
@everett_toews