相关疑难解决方法(0)

com.sun.xml.internal.ws.client不存在

我正在尝试捕获ClientTransportException,我的程序在编译阶段失败,出现以下异常

[ERROR]\workspace\rates\java\service\bundle1\src\main\java\com\connector\ws\TestClass1.java:[72,70] package com.sun.xml.internal.ws.client does not exist
Run Code Online (Sandbox Code Playgroud)

据我所知,这个包来自rt.jar并存在于jre中

如果我添加@SuppressWarnings("restriction"),它将从Eclipse Maven插件编译,但不能从IntelliJ Idea(通过maven)或命令行编译.

当我删除@SuppressWarnings时,Eclipse显示以下警告

Access restriction: The type ClientTransportException is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
Run Code Online (Sandbox Code Playgroud)

我发现了类似的问题,但它的答案对我来说不够清楚,因为我可以在rt.jar中使用这个类,我的IntelliJ Idea也可以看到它.

有人可以解释这种行为和可能的解决方案吗?

java

19
推荐指数
2
解决办法
5万
查看次数

标签 统计

java ×1