Tried running ant on some example source and keep getting this error..

Does anyone know as I'm assuming i'm maybe missing the ejb libs but am pointing to the glassfish/jdk which should have them? I also thought JSE compiles JEE code?

thanks.

Z:\My Desktop\ejb3-samples\chapter1>ant
Buildfile: Z:\My Desktop\ejb3-samples\chapter1\build.xml

common:
     [echo] BuildName: chapter1
     [echo] BuildHome: Z:\My Desktop\ejb3-samples\chapter1
     [echo] BuildFile: Z:\My Desktop\ejb3-samples\chapter1\build.xml
     [echo] BuildJVM: 1.6

java-env-check:

init:
     [echo] -----> Initializing project properties

setup:
     [echo] -----> Creating the required sub-directories

compile-ejb-classes:
     [echo] -----> Compiling EJBs
    [javac] Z:\My Desktop\ejb3-samples\chapter1\build.xml:136: warning: 'include
antruntime' was not set, defaulting to build.sysclasspath=last; set to false for
 repeatable builds
    [javac] Compiling 2 source files to Z:\My Desktop\ejb3-samples\chapter1\buil
d\chapter1-ejb\bean
    [javac] Z:\My Desktop\ejb3-samples\chapter1\src\ejb\bean\ejb3inaction\exampl
e\HelloUser.java:2: package javax.ejb does not exist
    [javac] import javax.ejb.Remote;
    [javac]                 ^
    [javac] Z:\My Desktop\ejb3-samples\chapter1\src\ejb\bean\ejb3inaction\exampl
e\HelloUser.java:3: cannot find symbol
    [javac] symbol: class Remote
    [javac] @Remote
    [javac]  ^
    [javac] Z:\My Desktop\ejb3-samples\chapter1\src\ejb\bean\ejb3inaction\exampl
e\HelloUserBean.java:2: package javax.ejb does not exist
    [javac] import javax.ejb.Stateless;
    [javac]                 ^
    [javac] Z:\My Desktop\ejb3-samples\chapter1\src\ejb\bean\ejb3inaction\exampl
e\HelloUserBean.java:3: cannot find symbol
    [javac] symbol: class Stateless
    [javac] @Stateless

    [javac]  ^
    [javac] 4 errors

BUILD FAILED
Z:\My Desktop\ejb3-samples\chapter1\build.xml:136: Compile failed; see the compi
ler error output for details.

Total time: 1 second

Z:\My Desktop\ejb3-samples\chapter1>

Recommended Answers

All 2 Replies

You'll need to make sure the J2EE libs are included on your build classpath. You can read about doing this with ant here: http://download.oracle.com/javaee/5/tutorial/doc/bnaan.html#gexah
or perhaps you may want to look where you got the example code from to see if they have any instructions for use with their build files.

Thanks, I'm using a mac and wasn't calling ${J2EE_HOME}, I should have changed the any files to ${env.J2EE_HOME}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.