By removed does this mean they are completely removed from the jdk 9 or are they marked as deprecated?
Some have been just marked as deprecated. Others have been removed entirely., though generally not in Java 9. Most of the removals were done later, and some are still to occur. If you look at elements that are now annotated as @Deprecated
, the annotation in some cases will formally indicate that the element is going to be removed.
Given the above statement, if in case the project is jdk 8 compiled, would it run without any issues on jdk 17
Not necessarily. Another thing that has happened is that access to "internal" Java SE APIs has been progressively closed off. So if your application uses these APIs, in Java 9 you got warnings, by Java 11 you got errors by default, and by Java 17 some access has become (I think) impossible.
So ... there can be "issues".
The correct approach to migration is simply to do it. And test, test, test until you have ironed out all of the problems.
Obviously, that means that you need a test server, and you need to use an automated test framework with unit tests, functional tests, UI tests and so on. But those are just good Software Engineering practices. You should already be following them.
I am planning to compile in jdk 8 and then run on jdk 17 until the entire project is jdk 17 compliant (By jdk 17 compliant, I meant to use the updated APIs rather the the existing deprecated APIs of jdk8).
Am I headed in the correct direction? or should I follow a different migration approach?
No. As @Holger points out, you are liable to run into lots of runtime errors ... due to problems that the Java 17 compiler would have identified.
There is only one approach ... really. Compile on Java 17 until you have identified all of the compile time dependency problems; i.e. using APIs that have been removed or closed off. Then run on Java 17 and test, test and test until you have found all of the other problems.
Before you start, it would be advisable to check all of your project's dependencies (libraries, etc) to see if they are supported on Java 17. Then update them to the correct (probably latest) versions.
Java 17 has only been released for a few weeks, so there is a good chance that some of your dependencies haven't caught up yet. If that is the case, it may be a better idea to target Java 11 LTS at this stage.