# Use Docker Executor based on the Java Version used in the repository

**URL:** <https://discuss.circleci.com/t/use-docker-executor-based-on-the-java-version-used-in-the-repository/53125>\
**Category:** Programming Languages\
**Tags:** java, config, docker, machine-executor\
**Created:** [April 18, 2025, 3:41pm UTC](https://discuss.circleci.com/t/use-docker-executor-based-on-the-java-version-used-in-the-repository/53125 "2025-04-18T15:41:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![devarsh10](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@devarsh10](https://discuss.circleci.com/u/devarsh10)\
**Post date:** [April 18, 2025, 3:41pm UTC](https://discuss.circleci.com/t/use-docker-executor-based-on-the-java-version-used-in-the-repository/53125/1 "2025-04-18T15:41:18Z")

</div>

In my current project I want to use the docker executor based on the version of JAVA being used in our repository.

1. This is the approach I have in my mind.

2. One of my senior have gave one approach that, we can create lists of repositories using the Java Version, and based on that we can decided which docker-executor to use.

Which ideal approach am I suppose to follow?

Here’s the first few lines of code:

```auto
version: 2.1
orbs:
  docker-buildx: devarsh/docker-buildx-orb@0.1.1
executors:
  docker-executor:
    docker:
      - image: circleci/openjdk:13.0-buster-node-browsers-legacy

```
