Sunday, March 15, 2015

startWeblogic.sh : The JRE was not found in directory ....

After installing WLS and creating a new domain, I do:

cd /opt/oracle/wlsdomains/domains/mydomain

./startWebLogic.sh



and I get the stinky dreaded message:

 
The JRE was not found in directory /usr/java/. (JAVA_HOME)
Please edit your environment and set the JAVA_HOME
variable to point to the root directory of your Java installation.





First I check all the "*.properties" files in the binary installation contain the right JAVA_HOME :
find /opt/oracle/middleware11g/ -name "*.properties" -exec cat {} \; | grep JAVA_HOME
After a quick grep I find out that this messages comes from /opt/oracle/wlsdomains/domains/mydomain/bin/setDomainEnv.sh

I hack the file to contain:

JAVA_VENDOR="Oracle"
export JAVA_VENDOR

BEA_JAVA_HOME="/usr/java/jdk1.7.0_55/"
export BEA_JAVA_HOME

SUN_JAVA_HOME="/usr/java/jdk1.7.0_55/"
export SUN_JAVA_HOME



and also I make sure that the jdk installation belongs to the same user that installed WebLogic (it used to be root) and things now work fine.

I think the root issue is that I didn't specify the JAVA_HOME in the silent installation configuration xml:

See http://www.javamonamour.org/2013/04/weblogic-silent-installation.html for a well tested silent installer.

I will spend the rest of the day pondering on why on Earth Oracle doesn't want to provide a single point of configuration for all Oracle products, rather than spreading around configuration in zillion of files.



2 comments:

Unknown said...

Even I am facing the same. I done everything to set. But still it is not working.

vernetto said...

better to reinstall everything from scratch.... or use some Docker WebLogic images available on hub.docker.com