且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

由于对所需库 rt.jar 的限制而导致对类的访问限制?

更新时间:2023-09-14 21:44:58

还有另一种解决方案也有效.

There's another solution that also works.

  1. 转到项目属性中的构建路径设置.
  2. 删除JRE 系统库
  3. 把它加回来;选择添加库",然后选择JRE 系统库.默认设置对我有用.
  1. Go to the Build Path settings in the project properties.
  2. Remove the JRE System Library
  3. 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.jarsaaj-api-1.3.jarrt.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