Question: Can anyone tell me how I can convert a .java file into .class file with an executable bytecode?

Answer: 
I would suggest you read the appropriate sections in The Java Tutorial from Sun:

<http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html>
You can not compile any java file to class directly.
It should have main method to compile it in class file