JAVA_HOME not set for wso2server.bat

I am trying to run wso2server.bat in windows and i have set the JAVA_HOME variable in the system variables.

Althgouh when i go into the bin folder of the wso2 folder and i run:

wso2server.bat i get the following error message: "You must set the JAVA_HOME variable before running CARBON"

Is there any further configuration that needs to be set for carbon to recognize the JAVA_HOME variable?

Upvotes: 1

Views: 8105

Answers (3)

Niyazi Ozturk
Niyazi Ozturk

Reputation: 31

Try either of this

Windows 10 – Search for Environment Variables then select Edit the system environment variables 1 -Click the Environment Variables button. 2- Under System Variables, click New. 3In the Variable Name field, enter either: JAVA_HOME if you installed the JDK (Java Development Kit) or JRE_HOME if you installed the JRE (Java Runtime Environment) In the Variable Value field, enter your JDK or JRE installation path in a cmd window

C:\Program Files\Java\jdk-15.0.2

echo %JAVA_HOME%

after these steps above try to run wso2server.bat under the installation location. If this doesn't work then, try to adjust this bat file with the JAVA_HOME location

launcher_wso2server.bat

e.g.

if "%JAVA_HOME%"=="" set JAVA_HOME="%~sdp0..\jdk-15.0.2\bin"

Upvotes: 0

tonakai
tonakai

Reputation: 835

try to remove the \bin from the JAVA_HOME

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

Upvotes: 9

As Tonakai answered the bin should not be part of the JAVA_HOME variable. After removal it worked fine.

Upvotes: 0

Related Questions