Appendix A. Additional Tools
In this appendix, we will discuss two tools that used to ship as part of the JDK but are now either deprecated or only available as separate downloads. The tools are:
-
Nashorn
-
VisualVM
Nashorn is a fully compliant implementation of JavaScript and an accompanying shell and was first made available as part of Java 8, but is officially deprecated as of Java 11.
JVisualVM (often referred to as VisualVM) is a graphical tool, based on the Netbeans platform. It is used for monitoring JVMs and essentially acts as an equivalent, graphical aggregate of many of the tools featured in “Command-Line Tools”.
Introduction to Nashorn
In this section, we will assume some basic understanding of JavaScript. If you aren’t already familiar with basic JavaScript concepts, then Head First JavaScript by Michael Morrison (O’Reilly) is a good place to start.
If you recall the comparison between Java and JavaScript outlined in “Java Compared to JavaScript”, you know that the two languages are very different. It may, therefore, seem surprising that JavaScript should be able to run on top of the same virtual machine as Java.
Non-Java Languages on the JVM
In fact, there are a very large number of non-Java languages that run on the JVM—and some of them are a lot more unlike Java than JavaScript is. This is made possible by the fact that the Java language and JVM are only very loosely coupled, and only really interact via the definition of the class file format. This can be ...
Get Java in a Nutshell, 7th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.