The likely problem is that your path is targeting the wrong version of java.
Try the following first (I'm assuming a Windows installation):
Navigate to your %PROGRAMFILES%\Java
folder
You may see multiple installations of Java - look for the most recent update (assuming the install had no errors)
Launch a command prompt within your %PROGRAMFILES%\Java
folder and then change to the relevant java version and retry your commands from the bin folder using the full path to your java file(s). If it works then we have found the culprit.
You now need to edit your environment variables to point to the correct path.
Go to your environmental variables, and edit the PATH (CLASSPATH if necessary), changing
On 32 bit Windows
"C:\Program Files\Java\jdkINCORRECTJAVAVERSION\bin\" to
"
C:\Program
Files\Java\CORRECTJAVAVERSION\bin\"
On 64 bit Windows
"C:\Program Files (x86)\Java\jdkINCORRECTJAVAVERSION\bin\" to
"C:\Program Files (x86)\Java\CORRECTJAVAVERSION\bin\"