Using OpenJDK 8

OpenJDK 8 is present in the CircleCI LXC Container but in order to use it, you need to add the following to your circle.yml file.

dependencies:
  pre:
    - sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0/bin/java
    - sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
    - echo 'export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64' >> ~/.circlerc

Credits: originally posted by @alexey and workaround was discovered by @kimh

where should it be added in machine section or dependencies section?

You can put this in the dependencies section.

thanks :grinning:

Clarified the example in the first post.