wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes EJB compilation - import javax.ejb.*; not found. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB compilation - import javax.ejb.*; not found." Watch "EJB compilation - import javax.ejb.*; not found." New topic

EJB compilation - import javax.ejb.*; not found.

Hemal Shah

Joined: Dec 04, 2001
Posts: 8
I am attempting to compile some EJB's (using the Ant tool). However I get compilation errors regarding the import of javax.ejb.*; - When I attempt to compile I get an error stating that this package (javax.ejb) can't be found! I have jdk1.3.1. Do I need some kind of Enterprise edition or is this package available on jdk1.3.1?
p.s. This is an example of the error I get :
[javac] C:\Individualproject\Jakarta\jakarta-ant-1.3\bin\src\uk\ac\ucl\aivet
ac\session\login\LoginWorkFlowBean.java:6: package javax.ejb does not exist
[javac] import javax.ejb.*;
[javac] ^
[javac] C:\Individualproject\Jakarta\jakarta-ant-1.3\bin\src\uk\ac\ucl\aivet
ac\session\login\LoginWorkFlowBean.java:16: cannot resolve symbol
[javac] symbol : class SessionBean
[javac] location: class uk.ac.ucl.aivetac.session.login.LoginWorkFlowBean
[javac] public class LoginWorkFlowBean implements SessionBean {
[javac] ^
Can anyone help?
[This message has been edited by Hemal Shah (edited December 04, 2001).]
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
The J2EE libraries do not come bundled with J2SE (the JDK). Whatever EJB server you want to deploy on will have a jar file (or more) you can compile with. You can also download J2EE development tools from http://java.sun.com/
Hemal Shah

Joined: Dec 04, 2001
Posts: 8
Does this mean that I have to have the classpath of the EJB server jar file set?
I'm a little confused - The EJB server provides a jar file - how do I get the EJB's to configure with this? Or is setting the classpath simply enough?
Thanks again.
Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
I was having the same problem on Windows2000. If you open the j2ee.jar with WinZip, you will see the files there. Icluding it in your CLASSPATH should work. I removed 1.2.1 and installed 1.3 and haven't gotten back to the point of compiling anything yet. Let us know if this solves your problem.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: EJB compilation - import javax.ejb.*; not found.
Similar Threads
NeedJ2EE 1.3 RI server Installation Help
error compiling ejb, first time prompt compile
classpath errors - need urgent help!
getting compiler error