See javac in Java Development Kit Tool Specifications. Use the new -release flag instead of the -sourceĪnd -target options. Use 6 or later.Įrror: Target option 1.5 is no longer supported. Warning: bootstrap class path not set in conjunction with -source 5Įrror: Source option 5 is no longer supported. In JDK 9 and above, those values cause an error. In JDK 8, -source and -target values of 1.5/5 and earlier were deprecated, and caused a warning. The supported -source/-target values are 20 (the default) till 7. If you use the -source and -target options with javac, then check the values that you use. This code generates the following error message from the compiler: M圜lass.java:2: error: as of release 9, '_' is a keyword, and may not be used as a legal identifier. It generates a warning in JDK 8, and an error, starting from JDK 9.Īs an example: static Object _ = new Object() ![]() ![]() Identifier in source code, then your code won’t compile in JDK 11 and later If you use the underscore character ("_") as a one-character If you need to compile your code with JDK 11 and later compilers, then take note of the following: For detailed information about the new features and changes in JDKįor detailed information about the new features and changes inįor detailed information about the new features and changes in JDK 12, see What's New in JDK 12 - New Features and Enhancements.įor detailed information about the new features and changes in JDK 11, see What’s New in JDK 11 - New Features andįor detailed information about the new features and changes in JDK 10, see What’s New in JDK 10.įor a comprehensive list of all of the new features of JDK 9, see What's New in JDK 9.įor detailed information about the changes in JDK 9, see JDK 9 Release Notes.Įven if your program appears to run successfully, you should complete the rest of the steps in this guide and review the list of issues.Ĭompiling your code with the latest JDK compiler will ease migration to future releases since the code may depend on APIs and features, which have been identified as problematic.To make your code work on the latest JDK release, understand the new features and changes in each of the JDK release.
0 Comments
Leave a Reply. |