title: java is not working in linux. Why?
body: <p>Currently working on <code>Linux Cinnamon</code>. I have unistall/removed <code>Open JDK</code> from my local drive. Then I checked <code>java -version</code> via terminal and gives - </p>
  
  <pre><code>$ java -version
  The program 'java' can be found in the following packages:
   * default-jre
   * gcj-5-jre-headless
   * openjdk-8-jre-headless
   * gcj-4.8-jre-headless
   * gcj-4.9-jre-headless
   * openjdk-9-jre-headless
  Try: sudo apt install &lt;selected package&gt;
  </code></pre>
  
  <p>After that following the installation guide to install <code>oracle jdk 8</code> for <code>linux</code>. Then I just checked <code>java -version</code> command through [I just unpack <code>jdk</code> to <code>/opt/java</code>]-</p>
  
  <pre><code>$ /opt/java/jdk1.8.0_112/bin/java -version
  java version "1.8.0_112"
  Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
  Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
  </code></pre>
  
  <p>I set my environment variable <code>JAVA_HOME="/opt/java/jdk1.8.0_112"</code> [excluding <code>bin</code>] to <code>/etc/environment</code> using nano thereafter <a href="https://askubuntu.com/questions/175514/how-to-set-java-home-for-java/175519">from JAVA_HOME setup tutorial</a> - </p>
  
  <pre><code># Java Home
  JAVA_HOME="/opt/java/jdk1.8.0_112"
  export JAVA_HOME
  </code></pre>
  
  <p>and refresh &amp; checked my <code>JAVA_HOME</code> as follows -</p>
  
  <pre><code>$ echo $JAVA_HOME
  /opt/java/jdk1.8.0_112
  </code></pre>
  
  <p>After these setup while I am trying check <code>java -version</code> via command it gives -</p>
  
  <pre><code>$ java -version
  The program 'java' can be found in the following packages:
   * default-jre
   * gcj-5-jre-headless
   * openjdk-8-jre-headless
   * gcj-4.8-jre-headless
   * gcj-4.9-jre-headless
   * openjdk-9-jre-headless
  Try: sudo apt install &lt;selected package&gt;
  </code></pre>
  
  <p>Can anyone tell me what is going on?</p>