Detect Java 1.8 as Java 6+ (#15259)

Change-Id: I17e41ce7f4f9d10e9f75c14acd9a880768e17e6e