Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Title Page
Copyright
Java 9 Cookbook
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
Installation and a Sneak Peek into Java 9
Introduction
Installing JDK 9 on Windows and setting up the PATH variable
How to do it...
Installing JDK 9 on Linux (Ubuntu, x64) and configuring the PATH variable
How to do it...
Compiling and running a Java application
Getting ready
How to do it...
New features in Java 9
How to do it...
JEP 102 -- Process API updates
JEP 110 -- HTTP/2 client
JEP 213 -- milling project coin
JEP 222: jshell -- the Java shell (Read-Eval-Print Loop)
JEP 238 -- multi-release JAR files
JEP 266 -- more concurrency updates
Project Jigsaw
There's more...
Using new tools in JDK 9
Getting ready
How to do it...
jdeprscan
jdeps
jlink
jmod
JShell
Comparing JDK 8 and JDK 9
Getting ready
How to do it...
See also
Fast Track to OOP - Classes and Interfaces
Introduction
Implementing object-oriented design using classes
Getting ready
How to do it...
How it works...
There's more...
See also
Using inner classes
Getting ready
How to do it...
How it works...
There's more...
See also
Using inheritance and composition to make the design extensible
Getting ready
How to do it...
How it works...
Composition makes the design more extensible
See also
Coding to an interface
Getting ready
How to do it...
How it works...
There's more...
See also
Creating interfaces with default and static methods
Getting ready
How to do it...
How it works...
See also
Creating interfaces with private methods
Getting ready
How to do it...
How it works...
There's more...
See also
Using enums to represent constant entities
Getting ready
How to do it...
How it works...
There's more...
Using the @Deprecated annotation to deprecate APIs
Getting ready
How to do it...
How it works...
There's more...
Using HTML5 in Javadocs
Getting ready
How to do it...
Modular Programming
Introduction
Using jdeps to find dependencies in a Java application
Getting ready
How to do it...
How it works...
There's more...
Creating a simple modular application
Getting ready
How to do it...
How it works...
See also
Creating a modular JAR
Getting ready
How to do it...
Using a module JAR with pre-JDK 9 applications
Getting ready
How to do it...
See also
Bottom-up migration
Getting ready
How to do it...
Modularizing banking.util.jar
Modularizing math.util.jar
Modularizing calculator.jar
How it works...
Top-down migration
Getting ready
How to do it...
Modularizing the calculator
Modularizing banking.util
Modularizing math.util
Using services to create loose coupling between consumer and provider modules
Getting ready
How to do it...
Creating a custom modular runtime image using jlink
Getting ready
How to do it...
Compiling for older platform versions
Getting ready
How to do it...
How it works...
Creating multirelease JARs
How to do it...
How it works...
Using Maven to develop a modular application
Getting ready
How to do it...
Going Functional
Introduction
Understanding and creating a functional interface
Getting ready
How to do it...
How it works...
There's more...
See also
Understanding lambda expressions
Getting ready
How to do it...
How it works...
There's more...
See also
Using method references
Getting ready
How to do it...
There's more...
See also
Creating and invoking lambda-friendly APIs
Getting ready
How it works...
There's more...
See also
Leveraging lambda expressions in your programs
Getting ready
How to do it...
There's more...
See also
Stream Operations and Pipelines
Introduction
Using the new factory methods to create collection objects
Getting ready
How to do it...
There's more...
See also
Creating and operating on streams
Getting ready
How to do it...
How it works...
There's more...
See also
Creating an operation pipeline on streams
Getting ready
How to do it...
There's more...
See also
Parallel computations on streams
Getting ready
How to do it...
See also
Database Programming
Introduction
Connecting to a database using JDBC
How to do it...
How it works...
There's more...
See also
Setting up the tables required for DB interactions
Getting ready
How it works...
There's more...
See also
Performing CRUD operations
Getting ready
How to do it...
There's more...
See also
Using prepared statements
Getting ready
How to do it...
There's more...
See also
Using transactions
Getting ready
How to do it...
There's more...
Working with large objects
Getting ready
How to do it...
There's more...
Executing stored procedures
Getting ready
How to do it...
There's more...
Concurrent and Multithreaded Programming
Introduction
Using the basic element of concurrency - thread
Getting ready
How to do it...
There's more...
See also
Different synchronization approaches
Getting ready
How to do it...
There's more...
See also
Immutability as a means to achieve concurrency
Getting ready
How to do it...
There's more...
See also
Using concurrent collections
Getting ready
How to do it...
How it works...
See also
Using the executor service to execute async tasks
Getting ready
How to do it...
How it works...
There's more...
See also
Using fork/join to implement divide-and-conquer
Getting ready
How to do it...
Using flow to implement the publish-subscribe pattern
Getting ready
How to do it...
Better Management of the OS Process
Introduction
Spawning a new process
Getting ready
How to do it...
How it works...
Redirecting the process output and error streams to file
Getting ready
How to do it...
There is more...
Changing the working directory of a subprocess
Getting ready
How to do it...
How it works...
Setting the environment variable for a subprocess
How to do it...
How it works...
Running shell scripts
Getting ready
How to do it...
How it works...
Obtaining the process information of the current JVM
How to do it...
How it works...
Obtaining the process information of the spawned process
Getting ready
How to do it...
Managing the spawned process
How to do it...
Enumerating live processes in the system
How to do it...
Connecting multiple processes using pipe
Getting ready
How to do it...
How it works...
Managing subprocesses
Getting ready
How to do it...
How it works...
GUI Programming Using JavaFX
Introduction
Creating a GUI using JavaFX controls
Getting ready
How to do it...
How it works...
Using the FXML markup to create a GUI
Getting ready
How to do it...
How it works...
See also
Using CSS to style elements in JavaFX
Getting ready
How to do it...
How it works...
Creating a bar chart
Getting ready
How to do it...
How it works...
See also
Creating a pie chart
Getting ready
How to do it...
How it works...
Creating a line chart
Getting ready
How to do it...
How it works...
See also
Creating an area chart
Getting ready
How to do it...
How it works...
See also
Creating a bubble chart
Getting ready
How to do it...
How it works...
See also
Creating a scatter chart
Getting ready
How to do it...
How it works...
See also
Embedding HTML in an application
Getting ready
How to do it...
How it works...
There's more...
Embedding media in an application
Getting ready
How to do it...
How it works...
There's more...
Adding effects to controls
How to do it...
How it works...
There's more...
Using the new TIFF I/O API to read TIFF images
Getting ready
How to do it...
RESTful Web Services Using Spring Boot
Introduction
Creating a simple Spring Boot application
Getting ready
How to do it...
How it works...
Interacting with the database
Getting ready
Installing MySQL tools
Creating a sample database
Creating a person table
Populating sample data
How to do it...
How it works...
Creating a RESTful web service
Getting ready
How to do it...
How it works...
Creating multiple profiles for Spring Boot
Getting ready
How to do it...
How it works...
There's more...
Deploying RESTful web services to Heroku
Getting ready
Setting up a Heroku account
Creating a new app from the UI
Creating a new app from the CLI
How to do it...
There's more...
Containerizing the RESTful web service using Docker
Getting ready
How to do it...
How it works...
Networking
Introduction
Making an HTTP GET request
How to do it...
How it works...
Making an HTTP POST request
How to do it...
Making an HTTP request for a protected resource
How to do it...
How it works...
Making an asynchronous HTTP request
How to do it...
Making an HTTP request using Apache HttpClient
Getting ready
How to do it...
There is more...
Making an HTTP request using the Unirest HTTP client library
Getting ready
How to do it...
There's more...
Memory Management and Debugging
Introduction
Understanding the G1 garbage collector
Getting ready
How to do it...
How it works...
See also
Unified logging for JVM
Getting ready
How to do it...
See also
Using the new diagnostic commands for the JVM
How to do it...
How it works...
See also
Try with resources for better resource handling
How to do it...
How it works...
See also
Stack walking for improved debugging
Getting ready
How to do it...
How it works...
See also
Some best practices for better memory usage
How it works...
See also
The Read-Evaluate-Print Loop (REPL) Using JShell
Introduction
Getting familiar with REPL
Getting ready
How to do it...
How it works...
Navigating JShell and its commands
How to do it...
Evaluating code snippets
How to do it...
There's more...
Object-oriented programming in JShell
How to do it...
Saving and restoring the JShell command history
How to do it...
Using the JShell Java API
How to do it...
How it works...
Scripting Using Oracle Nashorn
Introduction
Using the jjs command-line tool
Getting ready
How to do it...
There's more...
Embedding the Oracle Nashorn engine
Getting ready
How to do it...
Invoking Java from Oracle Nashorn
How to do it...
How it works...
There's more...
Using the ES6 features implemented in Oracle Nashorn
How to do it...
Testing
Introduction
Unit testing of an API using JUnit
Getting ready
How to do it...
How it works...
See also
Unit testing by mocking dependencies
Getting ready
How to do it...
How it works...
There's more...
See also
Using fixtures to populate data for testing
How to do it...
How it works...
See also
Behavioral testing
Getting ready
How to do it...
How it works...
← Prev
Back
Next →
← Prev
Back
Next →