尽管类路径中有 jar 文件,但包 javax.ejb 不存在 [英] package javax.ejb does not exist inspite of jar file in classpath
问题描述
我正在尝试使用命令编译一个 java 程序
I'm trying to compile a java program using command
javac -d build src/*.java -verbose
它返回给我以下内容:
srcCurrency.java:5: package javax.ejb does not exist
import javax.ejb.*;
^
srcCurrency.java:7: cannot find symbol
symbol: class EJBObject
public interface Currency extends EJBObject {
^
我使用的是 jdk1.6.0_35.CLASSPATH 包含 C:wls1036_devmodules,其中包含 javax.ejb.jar
I'm using jdk1.6.0_35. CLASSPATH contains C:wls1036_devmodules which contains javax.ejb.jar
可能是什么问题?
推荐答案
我遇到了同样的问题.
您需要将 javaee5.jar
添加到您的类路径中.
You need to add javaee5.jar
to you class path .
例如,我导入了一个 ejb 项目,然后意识到我使用的是一个没有 EJB & 的 Netbeans 版本.EAR 支持.所以我下载了插件.这样做之后, javaee5.jar 出现在 C:UserssjauharAppDataRoamingNetBeans7.3.1modulesext .将它添加到我的项目中,错误消失了.
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:UserssjauharAppDataRoamingNetBeans7.3.1modulesext . Added it to my project and the error went away .
这篇关于尽管类路径中有 jar 文件,但包 javax.ejb 不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!