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>
As the others stated : it's by compiling. You can use the javac command, but I'f you're new at java, I suggest you use a software for compiling your code (and IDE) such as [Eclipse](http://www.eclipse.org) and it will do the job for you.