title: ubuntu java environment path, bash: /etc/environment: permission denied?
body: <p>Using UBUNTU, I installed java 8 with the following command</p>
  
  <pre><code>$ sudo add-apt-repository ppa:webupd8team/java
  $ sudo apt-get update
  $ sudo apt-get install oracle-java8-installer
  
  $ sudo apt-get install oracle-java8-set-default
  </code></pre>
  
  <p>and I'm trying to set the <strong>java environment path</strong> as follow</p>
  
  <pre><code>$ cat &gt;&gt; /etc/environment &lt;&lt;EOL
  JAVA_HOME=/usr/lib/jvm/java-8-oracle
  JRE_HOME=/usr/lib/jvm/java-8-oracle/jre 
  EOL
  </code></pre>
  
  <p>but I get this <strong>error message</strong>:</p>
  
  <pre><code>bash: /etc/environment: permission denied
  </code></pre>