title: Elasticsearch Failed to start service in Ubuntu 20.04
body: <p>(I am new to elastic search)</p>
  <p>I want to start the elastic search as a service (sudo systemctl start elasticsearch), but it won't start, and throw an error as given below in the image
  <a href="https://i.stack.imgur.com/PF4EG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PF4EG.png" alt="enter image description here" /></a></p>
  <p>So after that, I went through to log file of elasticsearch log at <code>/var/log/elasticsearch/my-application.log</code>there I found some issues which is out of my range, The files attached below for error log is</p>
  <p><a href="https://filebin.net/ca3a5l67t2hqcexd" rel="nofollow noreferrer">https://filebin.net/ca3a5l67t2hqcexd</a></p>
  <p>The piece of code I have tried so far</p>
  <pre><code>sudo apt-cache search openjdk
  sudo apt-get install openjdk-11-jre openjdk-11-jdk
  java -version (openjdk 14.0.1 2020-04-14 OpenJDK Runtime Environment (build 14.0.1+7-Ubuntu-1ubuntu1) OpenJDK 64-Bit Server VM (build 14.0.1+7-Ubuntu-1ubuntu1, mixed mode, sharing))
  sudo gedit /etc/environment
  JAVA_HOME=&quot;/usr/lib/jvm/java-14-openjdk-amd64&quot;
  echo $JAVA_HOME (/usr/lib/jvm/java-14-openjdk-amd64)
  curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - (OK)
  echo &quot;deb https://artifacts.elastic.co/packages/7.x/apt stable main&quot; | sudo tee /etc/apt/sources.list.d/elastic-7.x.list  - (deb https://artifacts.elastic.co/packages/7.x/apt stable main)
  sudo apt-get update &amp;&amp; sudo apt-get install elasticsearch
  sudo gedit /etc/elasticsearch/elasticsearch.yml
  overwritted in yml file of elasticsearch
  (cluster.name: my-application
  node.name: magentocom
  network.publish.host: localhost
  discovery.seed_hosts: []
  network.host: 127.0.0.1
  http.port: 9200
  cluster.initial_master_nodes: 127.0.0.1)
  sudo systemctl start elasticsearch
  </code></pre>
  <p>I have also given permission as per suggested answer but still no success:
  <a href="https://stackoverflow.com/a/38539220/9427866">https://stackoverflow.com/a/38539220/9427866</a></p>
  <p>Any help will be appreciated!</p>