This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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 Java 8 in Action this week in the Java 8 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: 39578
    
  27
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 - updated with new look and Ping home screen widget
Rahul Iyer
Greenhorn

Joined: Mar 17, 2007
Posts: 8
Hi Ulf,
Thanks a lot!
It compiles just fine now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to find javax.ejb package
 
Similar Threads
Error while compiling
Compiling Client
Chapter 1 - Advice Client
AdviceClient compiler error in HFE
problem on hfejsb page 57