O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting ready

We need a sample application, which we can run against the jdeps command to find its dependencies. So, we thought of creating a very simple application that uses the Jackson API to consume JSON from the REST API: http://jsonplaceholder.typicode.com/users.

In the sample code, we also added a call to the deprecated JDK internal API, called sun.reflect.Reflection.getCallerClass(). This way, we can see how jdeps helps in finding dependencies to the JDK internal APIs.

The following steps will help you to set up the prerequisites for this recipe:

  1. You can get the complete code for the sample from the location, chp3/1_json-jackson-sample. We have built this code against Java 9 and it compiles well. So, you need not install something ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required