# Java in QIIME2 Docker images?

**URL:** https://forum.qiime2.org/t/java-in-qiime2-docker-images/4138
**Category:** User Support
**Tags:** docker
**Created:** [May 14, 2018, 12:17pm UTC](https://forum.qiime2.org/t/java-in-qiime2-docker-images/4138 "2018-05-14T12:17:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ylor](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@ylor](https://forum.qiime2.org/u/ylor)
#### Post date: [May 14, 2018, 12:17pm UTC](https://forum.qiime2.org/t/java-in-qiime2-docker-images/4138/1 "2018-05-14T12:17:00Z")

</div>

Hi,

First of all, if this is not the right category to post this question, I apologize -- feel free to move it to the appropriate category for discussion.

I am currently using QIIME2 version 2018.2. When I run java -version in the docker image, I get:

> bash: java: command not found

I assume this means that the QIIME2 docker image does not come with java installed or enabled? Is there a way to install Java into the QIIME2 docker image I have right now or are there any intentions of having Java installed in future docker image releases? I would like to use BBMap tools while in the QIIME2 docker image then go right into using QIIME2 commands.

Thanks!

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [May 14, 2018, 1:46pm UTC](https://forum.qiime2.org/t/java-in-qiime2-docker-images/4138/2 "2018-05-14T13:46:48Z")

</div>



---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [May 16, 2018, 12:50am UTC](https://forum.qiime2.org/t/java-in-qiime2-docker-images/4138/3 "2018-05-16T00:50:13Z")

</div>

Hi there @ylor! Fortunately for you, this is just what Docker was designed to do!

You can take a look at the [Dockerfile `FROM` directive](https://docs.docker.com/engine/reference/builder/#from), and define your own image, based on our official docker image:

```docker
# Dockerfile
FROM qiime2/core:2018.4

RUN conda install -c bioconda java-jdk

```

Note, this code is untested. Then, you can theoretically run something like this:

```bash
docker build -t ylor-q2-custom/2018.4 .

```

Then, once built, you can run using your new `ylor-q2-custom/2018.4` image!

Let us know how it goes! 🦖

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [May 16, 2018, 12:50am UTC](https://forum.qiime2.org/t/java-in-qiime2-docker-images/4138/4 "2018-05-16T00:50:21Z")

</div>



---

<div class="post-metadata">

### Author: ![ylor](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@ylor](https://forum.qiime2.org/u/ylor)
#### Post date: [June 5, 2018, 12:19pm UTC](https://forum.qiime2.org/t/java-in-qiime2-docker-images/4138/5 "2018-06-05T12:19:58Z")

</div>

Forgot to respond to this, but I was able to build a docker image with java based on your suggestion! Thanks @thermokarst!

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [July 6, 2018, 6:19pm UTC](https://forum.qiime2.org/t/java-in-qiime2-docker-images/4138/6 "2018-07-06T18:19:58Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
