"package javax.ejb does not exist"- a classpath problem.

Posted on 2004-11-17
Last Modified: 2013-11-24
I have checked the net and 99% of the time it is a classpath problem- but I still cannot fix it!

I am getting this with a run a preconfigured build.cmd file.
'package javax.ejb does not exist'

classpath = D:\jbuilder5\jdk1.3\javax.jar;D:\Program Files\Blazix;.

javax.jar contains javax\ejb, which contains the classes.

Any ideas
Question by:Eoinbn
    LVL 86

    Expert Comment

    Please post the output of this command from the command line:

    echo %CLASSPATH%

    Author Comment

    D:\jbuilder5\jdk1.3\javax.jar;D:\Program Files\Blazix;.

    including the '.'
    LVL 86

    Expert Comment

    The EJB classes may not be in javax.jar. Post the output of

    jar -tf javax.ejb | find "javax.ejb"

    Is there no j2ee.jar?

    Author Comment

    I assume I should be in the directory that javax.jar is in.
    I get the following error when I run your command- however should it be jar -tf javax.JAR instead of javax.EJB?? javax.ejb (The system cannot find the file specified)
            at Method)

    I have no j2ee.jar, so I downloaded the javax folder.
    LVL 86

    Expert Comment

    Doh sorry - typo!

    Should have been

    jar -tf javax.jar | find "javax.ejb"
    LVL 8

    Accepted Solution

    EJB's need j2ee.jar, like CEHJ mentioned above.
    The reason u dont have a j2ee.jar is that JBuilder EE  comes with Tomcat which is just a servlet container. So although it contains jar files to compile servlets, it does not contain j2ee.jar needed to compile ejbs.

    j2ee.jar will be available in any application server u have installed to run ur ejbs. If u haven't as yet u may download and install  j2ee RI from Sun's site (or any other server for htat matter) .
    In the lib directory within ur installation directory u'll find j2ee.jar , set classpath to it and everythign will be fine.

    Author Comment

    Thanks thomas. You have solved my problem, but it seems to have created another LOL

    thanks again.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Java 1603 Error 2 27
    nested class vs inner class 5 36
    Receive file in Servlet 1 28
    IT Company 5 56
    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
    This video teaches viewers about errors in exception handling.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now