# Install elsaticsearch on Ubuntu16

**URL:** https://discuss.elastic.co/t/install-elsaticsearch-on-ubuntu16/129163
**Category:** Elasticsearch
**Created:** [April 23, 2018, 6:47pm UTC](https://discuss.elastic.co/t/install-elsaticsearch-on-ubuntu16/129163 "2018-04-23T18:47:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![PieterV](https://avatars.discourse-cdn.com/v4/letter/p/58f4c7/32.png) [@PieterV](https://discuss.elastic.co/u/PieterV)
#### Post date: [April 23, 2018, 6:47pm UTC](https://discuss.elastic.co/t/install-elsaticsearch-on-ubuntu16/129163/1 "2018-04-23T18:47:59Z")

</div>

Is there a complete and definite guide for installing ES on Ubuntu16? I only find bits and pieces...

What I know so far is:

1. Install Java

2. Install elasticsearch

3. add non-root user (you cannot start ES as root) + change permissions of ES directories

4. Now I can start ES as nonroot (su nonroot):

**But now I get an error message:**  
`"error: Could not find or load main class org.elasticsearch.tools.launchers.JavaVersionChecker"`

It has something to do with starting up Java as non-user. So I checked java-version as nonroot (javac -version) and I saw no version...

So I changed /etc/profile with:

`nano /etc/profile`

And added:  
`JAVA_HOME=/usr/lib/jvm/default-java`  
`PATH=$PATH:$HOME/bin:$JAVA_HOME/bin`  
`export JAVA_HOME`  
`export JRE_HOME`  
`export PATH`

After a reboot I started ES as nonroot but I got the **same error** :  
`"error: Could not find or load main class org.elasticsearch.tools.launchers.JavaVersionChecker"`

The good thing is that I saw a java version as nonroot (java version "1.8.0\_171)".

**But what did I do wrong?**

---

<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: [May 21, 2018, 6:48pm UTC](https://discuss.elastic.co/t/install-elsaticsearch-on-ubuntu16/129163/2 "2018-05-21T18:48:01Z")

</div>

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