Eric Francis Eric Francis -3 years ago 189
Java Question

java EJB: The import javax.ejb cannot be resolved

I am reading the book Getting Started with WebSphere Application Server Community Edition.

I created an EJB project with Eclipse EE.

import javax.ejb.Local;


Error: The import javax.ejb cannot be resolved

I don't know why I cannot import this class.

Thanks

Answer Source

Probably the comments under the question already answered this, but just in case clarification is needed:

1) In Eclipse, right click on the project --> properties --> java build path

2) Click on add external JAR

3) Add c:\glassfish4\glassfish\lib\javaee.jar (Your directory path to this JAR can of course be different.)

--> Ok the dialog, and now Eclipse should be able to see javax.ejb.* classes.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download