android - 如何在 Eclipse 中解析 javax.xml.bind.JAXBContext?

标签 android eclipse jaxb

在我的 Android 应用中,我使用:

import javax.xml.bind.JAXBContext;

但是我得到:

The import javax.xml.bind cannot be resolved

我的插件列表中确实有 com.viewstreet.java.eclipse.jaxbplugin.JAXBPlugin

最佳答案

@commonsware 是正确的,只需在项目的 lib 文件夹中添加相应的 JAXB API jar 或者在 Maven 项目的情况下在 pom 文件中添加依赖项

<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.1</version>
</dependency>

在我的 linux 案例中,解决了这个问题

关于android - 如何在 Eclipse 中解析 javax.xml.bind.JAXBContext?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5849638/

相关文章:

android - Android XML 验证时的 ID 错误

android - GCM : why my application crash in GCMRegistrar. 检查设备(这个);

eclipse - SonarLint 无法连接到 SonarQube 服务器

java - 使用 jaxb2-annotate-plugin 和 XJC 工具自定义注释

android - 回收站 View 选择 : stop auto item deselection when touching to the blank space inside the recyclerview

java - Android - 2 个应用程序之间的 SharedPreferences 无法有效工作

java - JAXB 将子类的实例解码到列表中

java - 使用 JAXB 将 CSV 转换为 XML?

android - 无法为 android 编译 vlc

java - 如何使我的触发器在类路径(h2 数据库)中可用