WARNING: Use -illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: Please consider reporting this to the maintainers of WARNING: Illegal reflective access by (file:/C:/Jython/jython2.7.0/jython-standalone-2.7.0.jar) to method .SelChImpl.getFD() WARNING: An illegal reflective access operation has occurred In JDK 9, it is permitted by default and a warning is issued.įor example, here is the warning issued when starting Jython: >java -jar jython-standalone-2.7.0.jar This illegal reflective access will be disabled in a future release of the JDK. Some tools and libraries use reflection to access parts of the JDK that are meant for internal use only.
If the code uses reflection to call an internal API, then jdeps doesn’t warn you. Keep in mind that jdeps is a static analysis tool, and static analysis of code doesn’t tell you everything. If you use Maven, there’s a jdeps plugin available.įor jdeps syntax, see jdeps in the Java Platform, Standard Edition Tools Reference.
Please modify your code to eliminate dependency on any JDK internal APIs.įor the most recent update on JDK internal API replacements, please check:
Subject to be removed or changed incompatibly and could break your application. Warning: JDK internal APIs are unsupported and private to JDK implementation that are Sample -> 64Encoder JDK internal API (JDK removed internal API)
For example, if you run jdeps on a class that calls 64Encoder, you’ll see: To look for dependencies on internal JDK APIs, run jdeps with the -jdkinternals option. If you use internal APIs, then jdeps may suggest replacements to help you to update your code. Run the jdeps tool on your application to see what packages and classes your applications and libraries depend on.
The JDK 9 Release Notes contains details of changes to the javac compiler and source compatibility issues in JDK 9. You may encounter some source compatibility issues when recompiling. If you see deprecation with removal warnings, then you should address those to avoid future problems.Ī number of small changes have been made to javac to align it with the Java SE 9 Language Specification. You may see more deprecation warnings than previously. You may use the -add-exports option as a temporary workaround to compile source code with references to JDK internal classes. If possible, update your code to use the supported replacement APIs. To identify the dependencies, run the Java Dependency Analysis tool. You may get compilation errors that indicate that your application or its libraries are dependent on internal APIs. See JEP 182: Policy for Retiring javac -source and -target Options.Ĭritical internal JDK APIs such as are still accessible in JDK 9, but most of the JDK’s internal APIs are not accessible at compile time. Javac can recognize and process class files of all previous JDKs, going all the way back to JDK 1.0.2 class files.
The valid arguments for the -release flag follow the same policy as for -source and -target, one plus three back. source N -target N -bootclasspath $PATH_TO_rt.jar_FOR_RELEASE_N The -release N flag is conceptually a macro for: If possible, use the new -release flag instead of the -source and -target options. Use 1.6 or later.Įrror: Target option 1.5 is no longer supported. Warning: bootstrap class path not set in conjunction with -source 1.5Įrror: Source option 1.5 is no longer supported. In JDK 8, -source and -target values of 1.5/5 and earlier were deprecated and caused a warning to be generated. The supported -source/-target values are 9 (the default), 8, 7, and 6 (6 is deprecated, and a warning is displayed when this value is used). In JDK 9, javac uses a "one plus three back" policy of supporting -source and -target options. If you use the -source and -target options with javac, then check the values that you use. M圜lass.java:2: error: as of release 9, '_' is a keyword, and may not be used as a legal identifier. This code generates the following error message from the compiler: Its use generates a warning in JDK 8, and an error in JDK 9. If you use the underscore character ("_") as a one-character identifier in source code, then your code won’t compile in JDK 9. If you need to compile your code with the JDK 9 compiler then take note of the following: Compiling your code with the JDK 9 compiler will ease migration to future releases since the code may depend on APIs and features which have been identified as problematic.