Wednesday, 1 February 2017

Finding Java Home in Ubuntu

Often Ubuntu Users struggle with setting up of Apache Tomcat, Hadoop and other Java Technologies.

The reason being Java Home Error.

It is Either not set or incorrectly set due to mismatch in the java variant.

Java Variants

The java installation in Ubuntu comes in two ways

  1. Open Jdk
  2. Sun/Oracle Jdk
Always use the second one if you are working with android.

The Fix



The easiest way to fix this is to use the update-java-alternatives command

sudo update-java-alternatives -l

This will give you the java home.

Use this to java home in your config File.

Whenever updating apend a /jre at the end.

Screenshot


how to find java home ubuntu
update-java-alternatives
Example in this case value for Java_Home will be
/usr/lib/jvm/java-8-oracle/jre

No comments:

Post a Comment