This is the most reliable method. It ensures you are moving from older versions (like Java 8) to newer ones (like Java 17 or 21) if needed.