package javax.ejb does not exist inspite of jar file in classpath

13,944

I faced the same problem .

You need to add javaee5.jar to you class path .

For example I imported an ejb project and then realised I was using a version of Netbeans that did not have the EJB & EAR support . So i downloaded the plugin . After doing that the javaee5.jar was present at C:\Users\sjauhar\AppData\Roaming\NetBeans\7.3.1\modules\ext . Added it to my project and the error went away .

Share:
13,944
Asif Shiraz
Author by

Asif Shiraz

Updated on June 04, 2022

Comments

  • Asif Shiraz
    Asif Shiraz almost 2 years

    I'm trying to compile a java program using command

    javac -d build src/*.java -verbose
    

    It returns me the following:

    src\Currency.java:5: package javax.ejb does not exist
    import javax.ejb.*;
    ^
    src\Currency.java:7: cannot find symbol
    symbol: class EJBObject
    public interface Currency extends EJBObject {
                                  ^ 
    

    I'm using jdk1.6.0_35. CLASSPATH contains C:\wls1036_dev\modules\ which contains javax.ejb.jar

    What could possibly be the problem?

  • Asif Shiraz
    Asif Shiraz over 11 years
    Tried both. No luck :( Screen shot of error
  • GreyBeardedGeek
    GreyBeardedGeek over 11 years
    looks like you added it to the 'sourcepath' instead of the 'classpath'
  • alexjosesilva
    alexjosesilva over 6 years
    Pode ser adicionado diretamente ao projeto em Bibliotecas!