Core Java Advanced LiveLessons

Compiling and Scripting

Copyright © Cay S. Horstmann 2016

Run the Java compiler from a Java program

The Compiler API

Compilation Tasks

Capturing Diagnostics

In-Memory Compilation

lesson06/compiler

Use a scripting language in a Java program

The Scripting API

Bindings

Calling Functions and Methods

Implementing Java Interfaces

lesson06/script

Become familiar with the Nashorn JavaScript interpreter

The Nashorn JavaScript Engine

jjs

$ rlwrap jjs
var url = new java.net.URL('http://horstmann.com')
var input = new java.util.Scanner(url.openStream())
input.useDelimiter('$')
input.next()

Working with Java from Nashorn

jjs

var frame = new javax.swing.JFrame
frame.title = "Hello"
frame.setSize(200, 200)
frame.visible

Arrays, Lists, and Maps

Lambdas

Shell Scripting

lesson06/swapdir