• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. JDK 8
  4. Java Dependency Analysis Tool

Java Dependency Analysis Tool

  • Created by Mandy Chung, last modified on Mar 06, 2014

In JDK 8, a new command-line tool, jdeps, is added that developers can use to understand the static dependencies of their applications and libraries.  It also provides an -jdkinternals option to find dependencies to any JDK internal APIs that are unsupported and private to JDK implementation (see Why Developers Should Not Write Programs That Call 'sun' Packages).

Simple way to run jdeps to find out if your library/application depends on any JDK internal API:

$ jdeps -jdkinternals <one-or-more-jar-files....>

You can output the dependencies in DOT file format:

$ jdeps -dotoutput <output directory> -jdkinternals <one-or-more-jar-files....>

See the jdeps man page for more information.  jdeps is a static analysis tool on the given class files and dynamic class dependencies (Class.forName or loading of service providers etc) are not reported.

Below lists some of the JDK internal APIs and the recommended way to replace their usage.

Unsupported API (not for use)Supported APIs (please use instead)Note
sun.iojava.nio.charsets 

sun.misc.BASE64Decoder, sun.misc.BASE64Encoder,
com.sun.org.apache.xml.internal.security.utils.Base64

java.util.Base64See http://openjdk.java.net/jeps/135
sun.misc.ClassLoaderUtiljava.net.URLClassLoader.close() 
sun.misc.Servicejava.util.ServiceLoader 
sun.misc.UnsafeTBDA JEP will be submitted to define a supported API
sun.reflect.Reflection.getCallerClassTBDA JEP will be submitted to define a supported API
sun.security.x509.X500Namejavax.security.auth.x500.X500Principal 
com.sun.tools.javac.**javax.tools, javax.lang.model and com.sun.sourcecom.sun.tools.javac.Main is a supported API.
com.sun.image.codec.jpeg.**javax.imageioSee JDK-6527962
com.sun.net.ssl.**javax.net.ssl 
com.sun.rowset.**javax.sql.rowset.RowSetProvider 
sun.security.krb5.*

com.sun.security.jgss

If internal classes is used to get the session key of Krb5Context, we now have ExtendedGSSContext for this purpose.
com.sun.org.apache.xml.internal.securityjavax.xml.crypto 
Overview
Content Tools
ThemeBuilder
  • No labels

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.21
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 166, "requestCorrelationId": "579c6165a527d395"}