# My Docker Elasticsearch Keeps Failing Looking For JAVA?

**URL:** <https://discuss.elastic.co/t/my-docker-elasticsearch-keeps-failing-looking-for-java/272334>\
**Category:** Elasticsearch\
**Created:** [May 6, 2021, 7:40pm UTC](https://discuss.elastic.co/t/my-docker-elasticsearch-keeps-failing-looking-for-java/272334 "2021-05-06T19:40:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cis4life](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@cis4life](https://discuss.elastic.co/u/cis4life)\
**Post date:** [May 6, 2021, 7:40pm UTC](https://discuss.elastic.co/t/my-docker-elasticsearch-keeps-failing-looking-for-java/272334/1 "2021-05-06T19:40:55Z")

</div>

Good Day,

I'm trying to stand up a demo / test install of ES on Docker for Mac. I have a M1 (ARM) MacBook.

When I try to do the docker compose up I get the following error...

Attaching to elasticsearch, kibana  
elasticsearch | Error: could not find libjava.so  
elasticsearch | Error: Could not find Java SE Runtime Environment.  
elasticsearch exited with code 2

I have Java installed and even set the JAVA\_HOME variable... (My Terminal)  
cedricgaines@MyM1Air ESTest % java -version  
java version "16.0.1" 2021-04-20  
Java(TM) SE Runtime Environment (build 16.0.1+9-24)  
Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)

and when I echo JAVA\_HOME...  
cedricgaines@MyM1Air ESTest % echo $JAVA\_HOME  
/Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home

Here is the content of my simple docker-compose.yml file...  
`  
version: "3.1"

```
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.5.1
    container_name: elasticsearch
    environment:
      - xpack.security.enabled = false
      - discovery.type=single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    cap_add: 
        - IPC_LOCK
    volumes:
      - elasticsearch-data-volume:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
      - 9300:9300

  kibana:
    image: docker.elastic.co/kibana/kibana:6.5.1
    container_name: kibana
    environment:
      - ELASTICSEARCH_HOSTS=http://elasticsearch:9200
    ports:
      - 5601:5601
    depends_on:
      - elasticsearch
  
volumes:
  elasticsearch-data-volume:
        driver: local

```

`

What Am I Overlooking...

Thanks

---

<div class="post-metadata">

**Author:** ![vincenbr](https://avatars.discourse-cdn.com/v4/letter/v/8edcca/32.png) [@vincenbr](https://discuss.elastic.co/u/vincenbr)\
**Post date:** [May 6, 2021, 8:53pm UTC](https://discuss.elastic.co/t/my-docker-elasticsearch-keeps-failing-looking-for-java/272334/2 "2021-05-06T20:53:16Z")

</div>

Hi Cedric,  
Elasticsearch running in docker won't use your locally installed jvm, but rather the one which is bundled in the docker image provided by Elastic.  
And AFAIK arm architecture is not available in official docker image before 7.?  
Take a look at [elasticsearch | Docker @ Elastic](https://www.docker.elastic.co/r/elasticsearch) and put a arm-compatible image version in your docker-compose file.  
If you need precisely version 6.5.1, it's better to get the zipped elasticsearch version, install and run it on your local jvm.  
enjoy !

---

<div class="post-metadata">

**Author:** ![cis4life](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@cis4life](https://discuss.elastic.co/u/cis4life)\
**Post date:** [May 7, 2021, 6:13am UTC](https://discuss.elastic.co/t/my-docker-elasticsearch-keeps-failing-looking-for-java/272334/3 "2021-05-07T06:13:12Z")

</div>

That was my thoughts as well.

You are awesome!!! I tried a later version of an ES image 7.x and it worked 100% Then i went to my Windows Machine with Docker Desktop and WSL 2 and ran my test compose file with 6.5.1 and it worked as expected.

Thanks a lot

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 4, 2021, 6:13am UTC](https://discuss.elastic.co/t/my-docker-elasticsearch-keeps-failing-looking-for-java/272334/4 "2021-06-04T06:13:19Z")

</div>

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