无法导入javax.ejb。*包 [英] Cannot import javax.ejb.* packages
问题描述
我在构建一个 EJB
会话bean时遇到麻烦。
找不到以下包
import javax.ejb.LocalBean;
import javax.ejb.Stateful;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;
一些解决方案暗示添加库 j2ee.jar
和 javaee
.jar到java构建路径。我正在使用 jdk-7u75-windows-x64
和 java_ee_sdk-7-windows -ml
,并且找不到给定位置的任何这些库($ JAVA_HOME\lib)。我使用eclipse(开普勒)在一个 Windows 7 x64
机器
javaee.jar既没有eclipse也没有java(jdk)。该文件必须手动下载并添加到项目构建路径。 java ee 7 api可以在这里找到。
或者,a可以使用maven依赖关系:
<依赖关系>
< groupId> javax< / groupId>
< artifactId> javaee-api< / artifactId>
< version> 7.0< / version>
< / dependency>
I am having trouble in building an EJB
session bean.
The following packages
cannot be found:
import javax.ejb.LocalBean;
import javax.ejb.Stateful;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;
Some solutions implied adding the libraries j2ee.jar
and javaee
.jar to the java build path.
I am using jdk-7u75-windows-x64
and java_ee_sdk-7-windows-ml
and cannot find any of these libraries at the given location($JAVA_HOME\lib). I am using eclipse(kepler) on a Windows 7 x64
machine
javaee.jar ships with neither eclipse nor java(jdk). The file must be manually downloaded and added to the project build path. The java ee 7 api can be found here. Alternatively, a maven dependency can be used:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
</dependency>
这篇关于无法导入javax.ejb。*包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!