Access restriction on class due to restriction on required library rt.jar?

前端 未结 15 1711
忘掉有多难
忘掉有多难 2020-11-22 01:09

I\'m attempting to compile Java 1.4 code that was created by IBM\'s WSDL2Java on Java5 without recreating

15条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 01:35

    There's another solution that also works.

    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.

    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.

    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

提交回复
热议问题