Summary

This chapter covered the first of the two phases of code migration to Java 9-- the process of compiling or running your pre-Java 9 code in Java 9. We used a sample Java 8 project (without any internal API access) in order to compile and execute it in Java 9. We then looked at a class with a couple of deliberate internal API access instances and saw what the error we'll encounter looks like. We learned about the jdeps tool and how to use it to statically scan your code base and identify such instances.

Once the instances have been identified, we covered a couple of ways to solve the problem--using the suggested replacement APIs or using command-line flags to temporarily overcome the problem. We used both these options to get the previously failing code to compile and execute fine in Java 9. We then looked at a high level strategy to follow in order to complete the process of getting your legacy code to run in Java 9.

If you are working on code that you just need to maintain and are not likely to build on, this is where you could stop your migration journey. But, if you need to actively evolve the code, it's a good idea to go further than that. In the next chapter, we'll learn how to get it through the second phase of the Java 9 migration--to refactor it to use the Java 9 modularity features.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.97.216