Access restriction on class due to restriction on required library rt.jar?(由于对所需库 rt.jar 的限制,对类的访问限制?)
问题描述
我正在尝试编译 IBM 的 WSDL2Java 在 Java5 上创建的 Java 1.4 代码,而无需重新创建存根并在 Eclipse 中看到此错误.
我假设只要运行时 jars
可用(它们是),生成的存根就应该编译.
I'm attempting to compile Java 1.4 code that was created by IBM's WSDL2Java on Java5 without recreating the stubs and saw this error in Eclipse.
I'm under the assumption that the stubs generated should just compile as long as the runtime jars
are available (they are).
访问限制:由于所需库 C:Program FilesJavajdk1.5.0_16jrelib
t.jar 的限制,无法访问类型 QName
完整的类名是javax.xml.namespace.QName
这里到底发生了什么?这是我试图用香肠重构猪的情况吗?我最好重新创建存根吗?
What exactly is going on here? Is this a case where I am trying to refactor a pig from sausage? Am I better off recreating the stubs?
推荐答案
还有另一种解决方案也可以.
There's another solution that also works.
- 转到项目属性中的构建路径设置.
- 删除 JRE 系统库
- 添加回来;选择添加库" 并选择JRE 系统库.默认值对我有用.
- Go to the Build Path settings in the project properties.
- Remove the JRE System Library
- Add it back; Select "Add Library" and select the JRE System Library. The default worked for me.
这是因为你在不同的 jar 文件中有多个类.删除和重新添加 JRE 库将使正确的类成为第一.如果您想要一个基本的解决方案,请确保排除具有相同类的 jar 文件.
This works because you have multiple classes in different jar files. Removing and re-adding the JRE lib will make the right classes be first. If you want a fundamental solution make sure you exclude the jar files with the same classes.
对我来说,我有:javax.xml.soap.SOAPPart
在三个不同的 jar 中:axis-saaj-1.4.jar
、saaj-api-1.3.jar
和 rt.jar
For me I have: javax.xml.soap.SOAPPart
in three different jars: axis-saaj-1.4.jar
, saaj-api-1.3.jar
and the rt.jar
这篇关于由于对所需库 rt.jar 的限制,对类的访问限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:由于对所需库 rt.jar 的限制,对类的访问限制?


- 如何指定 CORS 的响应标头? 2022-01-01
- 如何使 JFrame 背景和 JPanel 透明且仅显示图像 2022-01-01
- 在 Java 中,如何将 String 转换为 char 或将 char 转换 2022-01-01
- 将 Java Swing 桌面应用程序国际化的最佳实践是什么? 2022-01-01
- 转换 ldap 日期 2022-01-01
- 未找到/usr/local/lib 中的库 2022-01-01
- Eclipse 的最佳 XML 编辑器 2022-01-01
- java.lang.IllegalStateException:Bean 名称“类别"的 BindingResult 和普通目标对象都不能用作请求属性 2022-01-01
- GC_FOR_ALLOC 是否更“严重"?在调查内存使用情况时? 2022-01-01
- 获取数字的最后一位 2022-01-01