Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution

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

Explorer

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

Accepted Solutions

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

Explorer

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

thank you very much!

29 REPLIES 29

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

Explorer

in test connection web,get error:Unexpected error. Unable to verify database connection

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

Explorer

who can help me?

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

To verify if Oracle Java was installed correctly, could you provide:

# rpm -qa | grep oracle
# ls -l /usr/java

Regards,
Gautam Gopalakrishnan

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

Explorer

[root@cdh1 ~]# rpm -qa | grep oracle
oracle-j2sdk1.7-1.7.0+update55-2.x86_64
[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 ~]#

 

 

Oracle Java was installed.

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

Explorer

how to set JAVA_HOME?

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

If you check the script /usr/share/cmf/bin/cmf-server on the host running
Cloudera Manager, you will see some checks for existing JDK locations. One
of them is /usr/java/jdk1.7* which matches your ls listing.

​re you able to run the "bin/java" program from that location and see if it
prints the right version?

# /usr/java/jdk1.7*/bin/java -version


Regards,
Gautam Gopalakrishnan

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

Explorer

here is my cloudera manager host show:

 

[root@cdh1 ~]# java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)


[root@cdh1 ~]# /usr/bin/java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)


[root@cdh1 ~]# /usr/java/jdk1.7.0_55-cloudera/bin/java -version
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)


[root@cdh1 ~]# echo $JAVA_HOME
/usr/java/jdk1.7.0_55-cloudera


[root@cdh1 ~]# ps -ef | grep cmf-server
root 1207 1 0 21:49 ? 00:00:00 su cloudera-scm -s /bin/bash -c nohup /usr/sbin/cmf-server
root 1495 1322 0 22:12 pts/1 00:00:00 grep cmf-server

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

Explorer

JAVA_HOME seted in /etc/profile. and centos installed on VMware.

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

Explorer

[root@cdh1 ~]# whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz

 

But in /usr/share/java directory have no file

Don't have an account?
Coming from Hortonworks? Activate your account here