You don't have to give any extension to the file name when you are running it.
That is if you have a program called Inventory.java ,after u compile it , a class file is generated Inventory.class.
When u run it, just the command would be
java Inventory
NOT java Inventory.class
No extension is required.(.class)
See if this was the problem.