Compile the two interfaces and the bean class

So far, we’ve written the two interfaces and the bean class, but we still have to compile them. After that, we’ll make the ejb-jar (which holds class files, not source files).

image with no caption

We’re using the -d compiler flag, so the command-line above says, “Compile all the .java files in the ‘headfirst’ directory, and then put the compiled .class files into the ‘classes’ directory, which you’ll find by going up one level from the current (src) directory. Oh yeah, almost forgot, be sure to put the classes in their correct PACKAGE directory. Look for the package structure inside the ‘classes’ directory, which means you should see a directory named ‘headfirst’, and THAT’s where the class files need to go...and if you do NOT find the ‘headfirst’ directory there, then make one for me. Thanks.”

Right now, this is how your projects directory structure should look:

image with no caption

Get Head First EJB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.