my dog learned polymorphism*
The moose likes EJB and other Java EE Technologies and the fly likes Unable to find javax.ejb package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Unable to find javax.ejb package" Watch "Unable to find javax.ejb package" New topic
Author

Unable to find javax.ejb package

Rahul Iyer
Greenhorn

Joined: Mar 17, 2007
Posts: 8
Hi,
I have written a program that runs the following imports:
import headfirst.*;
import javax.ejb.*;

When I run the following command:
javac -classpath {$CLASSPATH}:AdviceAppClient.jar AdviceClient.java

I get the following errors:
package headfirst does not exist
package javax.ejb does not exist

The funny thing is that if I try to compile using the following command:
javac AdviceAppClient.jar
then I do not get the error "package javax.ejb does not exist" , but I still get the error "package headfirst does not exist".

The file headfirst package is in a subdirectory called classes

Please help!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42364
    
  64
You need to add all classes that are used to the classpath. Try something like

javac -classpath classes:/path/to/ejb/classes/ejb.jar AdviceClient.java

and include the proper path to the jar file containing the EJB classes.


Ping & DNS - my free Android networking tools app
Rahul Iyer
Greenhorn

Joined: Mar 17, 2007
Posts: 8
Hi Ulf,
Thanks a lot!
It compiles just fine now.
 
 
subject: Unable to find javax.ejb package