Crowd cannot be started: JAVA_HOME is not configured correctly
Asked by Daniel Jilg:

While trying to install Crowd on Windows according to [this howto](/questions/ask/%JAVA_HOME%\bin), I stumbled over the above error. Here's some console output:

```
C:\Atlassian\Crowd>set jav
JAVA_HOME=C:\Java\jdk6

C:\Atlassian\Crowd>start_crowd.bat
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
C:\Atlassian\Crowd>
```

As you can see, my JAVA_HOME environment variable is actually pointed to a JDK directory. Also, this very server is already running multiple Atlassian apps (Jira, Confluence, Fisheye,...) which all work. So Java \*should\* be configured correctly.

Any ideas what could cause this? Where can I look? What can I do?


Answers:
author: MatthewC
body: Have you tried putting some debug into the batch files to see what is happening? start_crowd.bat just calls the catalina startup script so....

In start_crowd.bat put in
> echo Using JAVA_HOME: "%JAVA_HOME%"

Then do the same in
> C:\\Atlassian\\Crowd\\apache-tomcat\\bin\\catalina.bat

It might give you an idea what's going on.

comments: author: MatthewC
body: Just reading your error message it looks like it's finding Java somewhere (maybe system default JRE), do you get the same if you run it as an absolute path?
> C:\\Atlassian\\Crowd\\start_crowd.bat

and have you tried installing it as a service to see if it runs that way?

<http://confluence.atlassian.com/display/CROWD/Installing+Crowd+as+a+Windows+Service>


author: MatthewC
body: What version of crowd?


author: Daniel Jilg
body: Neat idea. Both report the correct path.

```
C:\Atlassian\Crowd>start_crowd.bat
Using JAVA_HOME:       "C:\Java\jdk6"
Using JAVA_HOME:       "C:\Java\jdk6"
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
```

Hmmmm I might try reinstalling Java.


author: Daniel Jilg
body: The current one, 2.3.2.

When running service.bat install Crowd, I get this error:  
C:\\Atlassian\\Crowd\\apache-tomcat\\bin\>service.bat install Crowd  
The tomcat.exe was not found...  
The CATALINA_HOME environment variable is not defined correctly.  
This environment variable is needed to run this program

The Catalina_Home env-variable is indeed set to something fishy, a nonexisting directory. However, I didn't set that variable myself.

C:\\Atlassian\\Crowd\\apache-tomcat\\bin\>set cat  
CATALINA_HOME=C:\\Atlassian\\Crowd\\apache-tomcat\\bin\\apache-tomcat

The fix is actually to set the CATALINE_HOME env-variable to the correct value myself, in my case C:\\Atlassian\\Crowd\\apache-tomcat.

Thanks for helping me figure that out.


author: Daniel Jilg
body: Apparently, CATALINA_HOME is set in start_crowd.bat, and it's set incorrectly in my opinion. I'll check, thanks very much.


author: MatthewC
body: Cool, glad I could help. One more thing, if something had set CATALINA_HOME then it might be something needs it, worth checking the other servers stop/start correctly at some point


author: Ryan Ward
body: I had this problem as well. Turned out I had both a JRE and a JDK installed. Even though my environment variable was set correctly and other Atlassian Apps worked fine, before the JDK, it still somehow picked up my JRE, probably from a bath.

I uninstalled the JRE and everything worked out just fine. At least got me one step closer to my install completing. Still trying to work out my other issue trying to connect crowd to MS SQL 2008R2.


Tags: crowd

java

java_home