当我尝试在IntelliJ中创建项目时,我在此行收到以下错误:
Sentence sent = new Sentence();
sent.emptySegments();
错误:
Error:(151, 10) java: cannot access javax.xml.bind.RootElement
class file for javax.xml.bind.RootElement not found
Sentence是一个实现RootElement接口的类
import javax.xml.bind.RootElement;
...
public class Sentence extends MarshallableRootElement implements RootElement {
所有包都存在,我可以跳转到每个接口或类的声明,但我不知道为什么IntellJ说它无法访问或找到它们?但是RootElement是一个接口,而不是一个类
public interface RootElement extends Element {
void validate() throws StructureValidationException;
}
上面的声明位于一个名为jaxb-rt-1.0-ea.jar的jar文件中,它存在于Project Librarians中.