I have installed Elasticsearch 6.x in my Debian 7 (wheezy). I tried to start with service elasticsearch start but its give me an error message
Debian 7 (wheezy)
service elasticsearch start
On Ubuntu 18.04, the solution was
sudo systemctl edit --full elasticsearch.service
adding a line
Environment=ES_JAVA_OPTS="-Djava.io.tmpdir=/var/lib/elasticsearch/tmp"
exitting with -x as in vi
restarting the service
sudo systemctl restart elasticsearch.service