Message-ID: <> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3766_1710494879.1495502381519" ------=_Part_3766_1710494879.1495502381519 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Java Dependency Analysis Tool

Java Dependency Analysis Tool

jdeps is a new command-line tool added= since JDK 8  for developers to use to understand the static dependenc= ies of their applications and libraries.   jdeps is a static anal= ysis tool on the given class files and dynamic class dependencies ( rName or loading of service providers etc) are not reported.

It also provides an -jdkinternals option to fi= nd dependencies to any JDK internal APIs that are unsupported and private t= o JDK implementation (see Why Developers Should Not Write Programs That Call 'sun' Packages).

Prepare for JDK 9

Most JDK's internal APIs are encapsul= ated in JDK 9.  JEP 261 specifies the critical internal= APIs that remain accessible until a replacement API is available in a futu= re release.  Other internal APIs are inaccessible by default.

To prepare for JDK 9, download J= DK 9 early-access build &n= bsp;and run jdeps to find out if your appli= cation and libraries depends on any JDK's internal API.

$ jdeps -dotoutput <dot-file-dir> -jdkinternals <one-or-more-=

This jdeps command will output the dependencies in DOT file format and o= ne output .dot file per JAR file.

Replace= use of JDK's internal APIs

Below lists some of the JDK's internal APIs and the recommended way to r= eplace their usage.   See JEP 261 for the `--add-exports` command= -line option to break in the encapsulation as a short-term migration purpos= e

Unsupported API (not for use) Supported APIs (please use instead) Note
core-libs java.nio.charsets @since 1.4  

sun.misc.BASE64Decoder, sun.misc.BASE64Encode= r,

java.ut= il.Base64 @since 8 See<= /a>
sun.misc.ClassLoaderUtil @s= ince 7



java.lang.ref.PhantomReference = @since 1.2

JDK-6417205 may help with the r= esource issues that can arise when mapped byte buffers are not unmapped in = a timely manner.  Libraries accessing sun.misc.Cleaner have to be fixe= d as direct byte buffer no longer uses sun.misc.Cleaner class; instead jdk.= internal.misc.Cleaner.


See JD= K-6685587 and JDK-4724038

sun.misc.Service java.util.ServiceLoader @since 1.6=  
sun.misc.Timer java.util.Timer @since 1.3  
sun.misc.Unsafe sun.misc.Unsafe consists of a number of use case= s.  The following features are identified to provide support in the fu= ture releases:


In progress for JDK 9:

sun.reflect.Reflection.getCallerClass java.lang.StackWalker::getCallerClass @since 9 See JDK-8043814 (= Stack Walking API)
sun.util.calendar.Zone= Info java.util.TimeZone or java.time AP= I @since 8  
security-libs* curity.PrivilegedAction to call System.getProperty or other action @since 1= .1

(PrivilegedAction<String>) () -> System.getProperty(key))= ;*

Some provided in com.= @sin= ce 1.9 = @since 1.9

jav= @since 1.9 =

If internal classes are used to= get the session key of Krb5Context, we now have ExtendedGSSContext for thi= s purpose.

JDK-8043071 resolved in JDK= 9 b25 s

java.lang.RuntimePermission, ja=, or specific Permission class @since 1.1<= /td> ointIdentificationAlgorithm("HTTPS"
or "LDAPS") ca= n be used to enabled hostname checking during handshaking .HttpsURLConnection.setHostnameVerifier() can be
customized hostname v= erifier rules for URL operations.
See also JDK-7192189  RFE to support the new endpoint identification.* @si= nce 1.4

JDK-= 8056174 defines API in JDK 9.  Th= is API can also be used to generate self-signed certificates. curity javax.xml.crypto @since 1.6** @since 1.4  

security provider implementatio= n class such as

  • com.sun.crypto.provider.SunJCE der(NAME) @since 1.3

where NAME is the security provider name such as= "SUN", "SunJCE".

In general, you should avoid depen= ding on a specific provider as it may not be available on other Java implem= entations. See O= racle security providers documentation for more rationale. or e("JavaPolicy", new; @since 1.6<= /p>

java.awt.peer and java.awt.dnd.pee= r

Instead of doing:

if (c.g= etPeer() !=3D null)  { .. }

could be replaced with:

=    if (c.isDisplayable())  { ... } 

To tes= t if a component has a LightweightPeer, use:

public boolean isLightweight() ; @since 1.2

To ob= tain the colo= r model of the component comes from the peer, instead of doing:

<= p>      getPanel().getPeer().getColorModel()
could be replaced with:

    public ColorModel getColorModel= ();


java.awt.peer.* and java.awt.dn= d.peer.* types are encapsulated.

API reference to java.awt.peer.* and= java.awt.dnd.peer.* types are removed in JDK 9.  See  JDK-8037739 and awt-dev discussion




javax.imageio @since 1.4 See JDK= -6527962 java.awt.Desktop @since 9 See net/jeps/272
com.sun.rowset.** javax.sql.rowset.RowSetProvider @since 7  

org.w3c.dom.{html, css, stylesheets}

org.w3c.dom.{html, css, stylesheet= s} APIs are JDK supported APIs @since 9.


JDK-8042= 244 resolved in JDK 9 b62

org.w3c.dom.xpath org.w3c.dom.xpath API is now JDK s= upported API @since 9

JDK-= 8042244 resolved in JDK 9 b62

JDK-8054= 196 for XPath support any API resolved in JDK 9 b49 solver.** javax.xml.catalog @since 9 See JDK= -8023732 (XML Catalog API)
org.relaxng.datatype org.relaxng.** will be repackaged = in JDK 9.  Users should include the org.relaxng.** types in the classp= ath. See JDK-8061466
Others**, javax.lang.model @since 1.6 com.sun.source.* @since 1.6 is a supp= orted API.** JEP 236 Parser API = for Nashorn JDK-804= 8176 (Nashorn Parser API) resolved in JDK 9 b55