Use both JDK7 and JDK8 in Travis

This should prevent issues like #1163.