I had this problem before, I cant remember the exact solution, but it was something to do with the path variables. You are looking in the right place! Make sure you dont have a duplicate entry. For instance a path to version 1.5 in the PATH variable, but also a ref to a variable such as JAVA_HOME which might be set to an older java version.
If you dont need the older version, Id search for it and make sure to remove it entirely from your system, that way you can be sure its gone.