`jdk` attribute in `.travis.yml` does not work with `language: python`

Our project is based on python. We need the Java 17 to run SonarCloud. The default Java version of Travis CI jobs is Java 11.

Suggested by docs, adding the jdk: openjdk17 in our .travis.yml. But still got java 11 with language: python. But it worked and got Java 17 with language: ruby.