# Using JDK 8 on a Python project

**URL:** <https://travis-ci.community/t/using-jdk-8-on-a-python-project/2725>\
**Category:** Xenial\
**Created:** [March 20, 2019, 2:15pm UTC](https://travis-ci.community/t/using-jdk-8-on-a-python-project/2725 "2019-03-20T14:15:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amoe](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/amoe/32/1718_2.png) [@amoe](https://travis-ci.community/u/amoe)\
**Post date:** [March 20, 2019, 2:15pm UTC](https://travis-ci.community/t/using-jdk-8-on-a-python-project/2725/1 "2019-03-20T14:15:23Z")

</div>

Hi,

I saw several issues related to OpenJDK 11 being installed by default, like:

> [@How to use Java8 in a python/non-java project on Xenial?](https://travis-ci.community/t/how-to-use-java8-in-a-python-non-java-project-on-xenial/1823):
>
> We are trying to upgrade the travis configuration for [https://github.com/dpkp/kafka-python](https://github.com/dpkp/kafka-python) to Xenial, but have not been successful so far. This is a python client project that tests against a java backend service (kafka). Some of the kafka versions we test against are quite old and require java 8 / will not work on java 11. Any tips to get opendjk or oracle java installed? the simple ‘jdk:’ directive seems to be ignored because we are a non-java project. Trying to install oracle-java8-set-defau…

[https://travis-ci.community/t/oracle-jdk-11-and-10-are-pre-installed-not-the-openjdk-builds](https://travis-ci.community/t/oracle-jdk-11-and-10-are-pre-installed-not-the-openjdk-builds)

I wanted to share a hacky workaround that I’ve done on my project.

> **[GitHub - amoe/travis-polyglot-test](https://github.com/amoe/travis-polyglot-test)**
>
> Contribute to amoe/travis-polyglot-test development by creating an account on GitHub.

The approach is basically to manually put jdk\_switcher into the repository (as it doesn’t get installed without `language: java`), then filter the JDK11 directory out of the PATH variable.

If someone has a better solution to this problem, I’d love to know one.

Cheers,  
Dave

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [October 25, 2020, 2:45am UTC](https://travis-ci.community/t/using-jdk-8-on-a-python-project/2725/2 "2020-10-25T02:45:18Z")

</div>

(dummy post to mark the topic resolved as it doesn’t require a reply)
