views:

40

answers:

1

I have installed the JDK, to C:\jdk, the JAVA_HOME variable is set to C:\jdk\jdk, and when I echo %JAVA_HOME% I get C:\jdk\jdk. Yet Tomcat complains.

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

I seem to be having errors with my environment variables. Often when I start a Command Line instance from the start menu, I receive different variables, to when I start an instance from the Windows 7 Right click > Open Command Window here.

What gives?

A: 

does C:\jdk\jdk have a bin/ directory? if not, try setting java home to just c:\jdk. failing that find out where the bin/ directory that has javac.exe in it and use the parent directory of bin/ for java home.

Ray Tayek
for example, mine is C:\Program Files\Java\jdk1.6.0_20\
Ray Tayek
Yep it does have the bin directory in it. I can go "javac" from the command line and it works.
Dominic Bou-Samra
very strange. maybe it needs a path to %JAVA_HOME$\bin. failing that, try installing the jdk with the installer so it goes into a more standard place (like mine: C:\Program Files\Java\jdk1.6.0_20\).
Ray Tayek
Will try this soon.
Dominic Bou-Samra