Welcome to JavaRanch
Please give more
details of the errors; does the compiler run, does the code compile, and if so, does it run?
I think you are making life unnecessarily difficult for yourself setting the PATH from the command line; set the path permanently (there are links from the
common problems page) and you won't need to do it until you upgrade your Java installation.
You ought not to have any difficulty having two versions installed; you are simply using whichever appears first in your PATH and ignoring the other.