Try sudo update-alternatives –config java from the command line to set the version of the JRE you want to use. This should fix it.
Copy the contents of the PATH settings to a notepad and check if the location for the 1.4.2 comes before that of the 7. If so, remove the path to 1.4.2 in the PATH setting and save it.
After saving and applying “Environment Variables” close and reopen the cmd line. In XP the path does no get reflected in already running programs.