You compile your classes in the usual way. However most EJB servers also require additional classes to be created and compiled to complete the bean. For example, WebLogic has a utility named "ejbc". You'll have to check the docs for your particular platform.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.