如何解决javax.xml.bind.JAXBContext在Eclipse?如何解决、javax、xml、Eclipse

2023-09-13 02:06:29 作者:千雪

在我的Andr​​oid应用程序使用:

In my android app I use:

进口javax.xml.bind.JAXBContext;

import javax.xml.bind.JAXBContext;

但我得到:

进口javax.xml.bind中不能得到解决。

The import javax.xml.bind cannot be resolved

我有com.viewstreet.java.eclipse.jaxbplugin.JAXBPlugin在我的插件列表...

I do have "com.viewstreet.java.eclipse.jaxbplugin.JAXBPlugin" in my plugins list...

推荐答案

将在项目的库/ 目录中的JAR,然后通过添加添加到构建路径JAR文件按钮。这是我的标准配方,似乎工作,它有把JAR在合适的地方的命令行的优势,构建也是如此。

Put the JAR in the project's libs/ directory, then add it to the build path via the Add JARs button. That's my standard recipe, and it seems to work, and it has the advantage of putting the JAR in the right spot for command-line builds as well.

在这一点上,不过,我怀疑你会得到一个编译错误。通常情况下,你不能在 Java导入类的javax 封装成一个Android项目。

At this point, though, I suspect that you will get a compile error. Generally, you cannot import classes in the java and javax packages into an Android project.