Discussion:
Understanding these Errors and how to Resolve.
Edward Urbanek
2018-01-29 19:22:40 UTC
Permalink
I am looking at your article ...
http://openejb.apache.org/hello-world.html

and I am getting this compilation error.
Would you know how to resolve, please?

Thanks,

Ed


javac -cp /cygdrive/e/EDU/EJB_EXP/Open_EJB/openejb-3.0/openejb-3.0/lib/javaee-5.0-1.jar -d . *.java


Hello.java:3: error: package javax.ejb does not exist
import javax.ejb.Remote;
^
Hello.java:4: error: cannot find symbol
@Remote
^
symbol: class Remote
HelloBean.java:3: error: package javax.ejb does not exist
import javax.ejb.Stateless;
^
HelloBean.java:4: error: cannot find symbol
@Stateless
^
symbol: class Stateless
4 errors

E.D. Urbanek
HumanIT
Solutions, LLC
(937) 470-1201
www.HumanIT.us<http://www.humanit.us/>
Svetlin Zarev
2018-01-30 11:18:04 UTC
Permalink
Hi,

The JavaEE api jar is not in your class path. Unfortunately the javac
compiler does not complain about missing jars put in the -cp parameter. You
should make sure that this location is correct and the file exists:
/cygdrive/e/EDU/EJB_EXP/Open_EJB/openejb-3.0/openejb-3.0/lib/javaee-5.0-1.jar


Also I'd recommend you that you use a proper IDE and build system like
maven/gradle instead of a text editor. It would make your life much easier.
And last but not least - you should check the latest examples, as
openeejb-3 is quite old.

https://github.com/apache/tomee/tree/master/examples/ejb-examples
http://tomee.apache.org/examples/ejb-examples.html

Best regards,
Svetlin
Post by Edward Urbanek
I am looking at your article ...
http://openejb.apache.org/hello-world.html
and I am getting this compilation error.
Would you know how to resolve, please?
Thanks,
Ed
javac -cp /cygdrive/e/EDU/EJB_EXP/Open_EJB/openejb-3.0/openejb-3.0/lib/javaee-5.0-1.jar
-d . *.java
Hello.java:3: error: package javax.ejb does not exist
import javax.ejb.Remote;
^
Hello.java:4: error: cannot find symbol
@Remote
^
symbol: class Remote
HelloBean.java:3: error: package javax.ejb does not exist
import javax.ejb.Stateless;
^
HelloBean.java:4: error: cannot find symbol
@Stateless
^
symbol: class Stateless
4 errors
E.D. Urbanek
HumanIT
Solutions, LLC
(937) 470-1201
www.HumanIT.us<http://www.humanit.us/>
Loading...