Are you sure of running your file.java from the position that you wrote it?
If yes just see the path you seted for your vm.
For example if you are running over windows from the msdos prompt check this file
AUTOEXEC.BAT (you'll have to open it with the notepad)
it should be located in the root folder of the main hard drive on your computer, usually C:
scroll down to the bottom of AUTOEXEC.BAT and add a new line that has the following format:
PATH SDKFolder\bin;%PATH%
replace SDKFolder with the name of the folder where you installed SDK
save and restart.