views:

45

answers:

3

I cannot run the java keyword from the console. What settings do I have to change on XP to get this working.

Thanks in advance.

+3  A: 
  1. Install the JVM (or JDK)
  2. Set the JAVA_HOME environment variable to the installation folder
  3. Add the executables location into the PATH environment variable (referencing JAVA_HOME)
  4. Optionally set a CLASSPATH environment variable to have a default classpath
Vinko Vrsalovic
+1  A: 

When you install the Sun JRE using its installer, there should be a java.exe file written to %windir%\SYSTEM32. Since this directory is on the PATH, it should be available on the command line.

If you installed Java via some other mechanism, you will have to locate the JRE's bin directory and configure PATH yourself.

McDowell
A: 

right click on computer -> property -> advanced -> environment variable then choose where save the path: - in user variable (the path is associated to the user, every other user cannot directly run java, without setting it up). - in system variable (every user can run java by console without specify the entire path).

choose row with path, double click -> at the end on the line add an ; and then specify the java installation path plus bin...

Exmple: I installed java in C:\Programs\Java so I have to put in path C:\Programs\Java\bin\

in Path I had: %CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32

after modification I'll have %CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32;C:\Programs\Java\bin\

Marcx