yes you need a main function that will run the code, and any corresponding classes you wish to run. You will need to compile the class with the main method in it just like any other class too.
If you're using a windows environment and you're NOT using an IDE such as Borland JBuilder or Eclipse, then you'll need to run the programs form a command prompt. For example, to compile a java class in a command prompt window you just type
javac [class_name].java
then to run it its just
java [class name]
Quite simple. Of course, if you are using packages it takes an extra annoying step but its not difficult at all. It seems weird to me that your teacher would teach you how to create a class but not teach you how to properly run that class.