The JRE was not found in directory C:\Program Files\Java\JDK18~1.0_2 when starting weblogic server
Asked Answered
L

4

5

I have installed Oracle soa suite quickstart 12c (12.2.1.4.0) in windows 7. The java version i'm using is jdk1.8.0_241.

After creating a standalone domain, when i tried to start the weblogic server using startWeblogic.cmd I got the following error.

The JRE was not found in directory C:\Program Files\Java\JDK18~1.0_2 <JAVA_HOME>
Please edit your environment and set the JAVA_HOME variable to the root directory of your Java installation.

Link to my cmd window

I have set the JAVA_HOME variable in my environment as follows

JAVA_HOME = C:\Program Files\Java\jdk1.8.0_241

Please suggest solutions to fix this issue.

Lex answered 30/3, 2020 at 3:55 Comment(1)
Avoid using spaces in path when installing WebLogic or Fusion Middleware products. Try to use quotes when you set your JAVA_HOME. set JAVA_HOME="C:\...."Mitran
B
6

You should set JDK path in 'setDomainEnv.cmd' file.

  1. Open 'setDomainEnv.cmd' file.

    (File path in my local PC is 'C:\oracle\mw\wls\dom_01\bin')
    
  2. Update the 'BEA_JAVA_HOME' path to your JDK home path.

    (Ex: set BEA_JAVA_HOME=C:\PROGRA~1\Java\jdk1.8.0_171)

NOTE: To find the directory short path in Windows, use dir /x in command prompt.

Brindabrindell answered 6/7, 2020 at 9:1 Comment(0)
L
1

I resolved it by following below steps.

First ,this error is caused by space in java installation directory (as in C:**Program Files**\Java\jdk1.8.0_241)

To overcome this you need to use quotes to set JAVA_HOME in some files in your Oracle home.

Few file where you need to check

oracle_home/middleware/oui/bin/launch.cmd
oracle_home/middleware/oui/bin/viewInventory.cmd
oracle_home/middleware/oui/bin/compareInventory.cmd
oracle_home/middleware/oui/bin/setProperty.cmd
oracle_home/middleware/oui/.globalEnv.properties
oracle_home/middleware/user_projects/domains/wls_domain/bin/setDomainEnv.cmd
oracle_home/middleware/user_projects/domains/wls_domain/bin/setNMJavaHome.cmd
oracle_home/middleware/user_projects/domains/wls_domain/init-info/domain-info.xml
oracle_home/middleware/user_projects/domains/wls_domain/init-info/startscript.xml
oracle_home/middleware/user_projects/domains/wls_domain/init-info/tokenValue.properties
oracle_home/middleware/user_projects/domains/wls_domain/init-`info/nodemanager-properties.xml
oracle_home/middleware/user_projects/domains/wls_domain/nodemanager/nodemanager.properties

In the above files if you find any lines like


set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_241 

if NOT exist %JAVA_HOME%\lib

set JAVA_HOME=%JAVA_HOME%

set JAVA_HOME=%%~fsi

Modify them to below format with quotes and save them.

set "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_241" 

if NOT exist "%JAVA_HOME%\lib"

set "JAVA_HOME=%JAVA_HOME%"

set "JAVA_HOME=%%~fsi"

`````

Now your system will recognize the java home without trouble
Lex answered 31/3, 2020 at 6:30 Comment(0)
C
1

just in case this can still be usefull for anyone. Just create an empty folder with exactly old jdk name and copy the content of thw new version inside this new folder. Basically both folders will have the same new java files...

Chickamauga answered 9/10, 2023 at 3:52 Comment(1)
This is one of the simple and best idea, its working as expectedJampan
I
0

I was getting following error when i started my weblogic 12:

The system cannot find the path specified.
The JRE was not found in directory C:\PROGRA~1\Eclipse Adoptium\jdk-8.0.322.6-hotspot. (JAVA_HOME)
Please edit your environment and set the JAVA_HOME
variable to point to the root directory of your Java installation.
Press any key to continue . . .

JDK I used was : Eclipse Adoptium\jdk-8.0.322.6-hotspot

Following below steps:

  1. create a folder "jdk-8.0.322.6-hotspot" in C: drive.
  2. Copy the content of "jdk-8.0.322.6-hotspot" folder from "C:\PROGRA~1\Eclipse Adoptium\jdk-8.0.322.6-hotspot" to C:\jdk-8.0.322.6-hotspot.
  3. Update JAVA_HOME=C:\jdk8\jdk-8.0.322.6-hotspot\jre in ..\base_domain\bin\setDomainEnv.cmd file.
  4. Start weblogic now.
Impostume answered 8/11, 2022 at 18:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.