pg_upgrade sets check_function_bodies to off, which should prevent function validation from doing anything more than basic checks. But the function validator in PL/Java 1.6 can incorrectly trigger the check for the contents of the sqlj schema, which during pg_upgrade may not be completely populated at the time, leading to a "Failed to recognize schema of PL/Java installation" error and a failed upgrade.
Workaround:
Add --new-options '-c pljava.enable=off' to the pg_upgrade command. The server log will then contain warnings about PL/Java being disabled, but the upgrade will complete.
Fix:
A future release should fix this.