I haven't done this in forever, but last time the recommended OpenJDK answer was somehow not right. Got the Oracle one, had to figure out where you extract the tarball to, fix my
PATH, yada yada.
That sounds fine though. The PATH variable is a nicety for the user to not need to type long paths, really like using ~ for the home directory, not for program setup.