Set Permanent Environmental Variable in Windows XP

Solution 1:

Per user settings command line:

% reg add KEY  /v JAVA_HOME /t REG_SZ /d "C:\java\jdk-1.4"

For user only settings replace KEY with:

HKCU\Environment

For per machine settings replace KEY with:

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

(Attention: there is a space in the last key, quote it with " !)