Support Questions

Find answers, ask questions, and share your expertise

Error: JAVA_HOME is not set and Java could not be found

avatar
Contributor

I installed cdh5.0 follow 'Installation Path B - Manual Installation Using Cloudera Manager Packages'

When i intalled oracle-j2sdk1.7-1.7.0 cloudera-manager-daemons-5.1.2 cloudera-manager-server-5.1.2 and cloudera-manager-server-db-2-5.1.2 in my linux6.4(64bit),on  Database Setup page,i got an error like this:

INFO [JvmPauseMonitor:debug.JvmPauseMonitor@236] Detected pause in JVM or host machine (e.g. a stop the world GC, or JVM not scheduled): paused approximately 1039ms: no GCs detected.
+ cat
+======================================================================+
| Error: JAVA_HOME is not set and Java could not be found |
+----------------------------------------------------------------------+
| Please download the latest Oracle JDK from the Oracle Java web site |
| > h  t t p : /  / w w w .or acl e . c o m/technetwork/java/javase/index.html < |
| |
| Cloudera Manager requires Java 1.6 or later. |
| NOTE: This script will find Oracle Java whether you install using |
| the binary or the RPM based installer. |
+======================================================================+
+ exit 1
 
what can i do ?
1 ACCEPTED SOLUTION

avatar
Contributor

I sucessfully reinstalled it by 'Installation Path A - Automated Installation by Cloudera Manager' after increase memory to 4GB.

thank you very much!

View solution in original post

29 REPLIES 29

avatar
Contributor

how to set java_home ?  

who can help me ?

avatar
Master Collaborator

you can set "JAVA_HOME" in /etc/defaults/cloudera-scm-server

 

add to the end of the file

 

export JAVA_HOME=/usr/java/jdk1.7.0_55

avatar
Contributor

Thank you for your help 

I set the java_home in /etc/default/cloudera-scm-server with 'export JAVA_HOME=/usr/java/jdk1.7.0_55-cloudera',but when click 'test connection' in Add Cloudera ManagementService with browser,i got the same error 'Unexpected error. Unable to verify database connection.', and the /var/log/cloudera-scm-server/cloudera-scm-server.log file show like this:

 

INFO [JvmPauseMonitor:debug.JvmPauseMonitor@236] Detected pause in JVM or host machine (e.g. a stop the world GC, or JVM not scheduled): paused approximately 1024ms: no GCs detected.

+======================================================================+
| Error: JAVA_HOME is not set and Java could not be found |
+----------------------------------------------------------------------+
| Please download the latest Oracle JDK from the Oracle Java web site |
| > http://www.oracle.com/technetwork/java/javase/index.html < |
| |
| Cloudera Manager requires Java 1.6 or later. |
| NOTE: This script will find Oracle Java whether you install using |
| the binary or the RPM based installer. |
+======================================================================+
+ exit 1

 

Here is the java_home configure show:

[root@cdh1 ~]# tail /etc/default/cloudera-scm-server
# Java Options.
#
# Default value sets Java maximum heap size to 2GB, and Java maximum permanent
# generation size to 256MB.
#

export CMF_JAVA_OPTS="-Xmx2G -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp"
export JAVA_HOME=/usr/java/jdk1.7.0_55-cloudera
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
[root@cdh1 ~]#
[root@cdh1 ~]#
[root@cdh1 ~]# echo $JAVA_HOME
/usr/java/jdk1.7.0_55-cloudera/
[root@cdh1 ~]# ls /usr/java/jdk1.7.0_55-cloudera/
bin db jre LICENSE README.html src.zip THIRDPARTYLICENSEREADME.txt
COPYRIGHT include lib man release THIRDPARTYLICENSEREADME-JAVAFX.txt
[root@cdh1 ~]#

 

Is there something wrong? any how can i do?

avatar
Master Collaborator

OK so realize NONE of this should be necessary, and this is not normal to need to configure things this way.  It is not necessary to have to set JAVA_HOME.

 

I think we need to focus on this part of the message, rather than the JAVA_HOME message which appears to be a false-positive error.

 

INFO [JvmPauseMonitor:debug.JvmPauseMonitor@236] Detected pause in JVM or host machine (e.g. a stop the world GC, or JVM not scheduled): paused approximately 1024ms: no GCs detected.

 

How much memory is configured for your VM you are attempting to run things on?  How much physical memory does the system you are running the VM on have?

 

It appears the 1.7 openJDK has been installed as well, which is alongside of the oracle JDK on the system.

 

What do you get for the following commands on the system:

 

# ls -l /usr/java

# yum list installed "*jdk*"


Thanks

Todd

 

 

 

 

 

avatar
Contributor

Thank you for your reply!

The memory is configured for my VM i'm attempting to run things on is 512MB, and physical memory the system i'm running the VM on is 8GB.

The following commands on the system get like this:

 

# ls -l /usr/java

total 4
drwxr-xr-x. 8 root root 4096 Sep 19 18:05 jdk1.7.0_55-cloudera

 

# yum list installed "*jdk*"

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.cug.edu.cn
* extras: mirrors.cug.edu.cn
* updates: mirrors.btte.net
base | 3.7 kB 00:00
extras | 3.3 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 5.3 MB 00:01
Installed Packages
java-1.7.0-openjdk.x86_64 1:1.7.0.65-2.5.1.2.el6_5 @updates

avatar
Contributor

Thank you for your help!

Memory configured for VM running things on is 512MB,and the physical memory the VM running on is 8GB.

The following commands get show:

 

[root@cdh1 ~]# ls -l /usr/java
total 4
drwxr-xr-x. 8 root root 4096 Sep 19 18:05 jdk1.7.0_55-cloudera

 

[root@cdh1 ~]# yum list installed "*jdk*"
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirrors.yun-idc.com
* extras: mirrors.yun-idc.com
* updates: mirrors.btte.net
base | 3.7 kB 00:00
extras | 3.3 kB 00:00
updates | 3.4 kB 00:00
Installed Packages
java-1.7.0-openjdk.x86_64 1:1.7.0.65-2.5.1.2.el6_5 @updates

avatar
Master Collaborator

Ok at this point I would suggest reviewing the "requirements" section, here.

 

http://www.cloudera.com/content/cloudera-content/cloudera-docs/CM5/latest/Cloudera-Manager-Installat...

 

Also realize you need memory for CDH, so running the VM at a minimum of 4GB memory is necessary.


The issue you are seeing is because there is not enough memory, Cloudera Manager and CDH are memory intensive applicaitons.   The JAVA_HOME error message you are seeing is due to this (the message is a false indication of the problem, as I stated in my previous note.

 

 

avatar
Contributor

Thank you very much!

I set the memory of VM to 4GB,but i got the same error.

avatar
Contributor

Need i reinstall the centos system?

avatar
Master Collaborator
No, that should not be necessary. Are there error messages in the cloudera manager logs? Exceptions maybe?