程序包sun.security.tools.keytool不存在


问题

在项目中使用 jdk中 sun.security.tools.keytool包下面的类报错:程序包sun.security.tools.keytool不存在

解决方案

  1. 在pom.xml中加入下面插件
  <build>
    <pluginManagement>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.2</version>
          <configuration>
            <fork>true</fork>
            <compilerArgument>-XDignore.symbol.file</compilerArgument>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  1. 在Libraries中加入jdk中lib里的tools.jar
    具体可参考:https://www.pianshen.com/article/1309655767/

参考:https://www.it1352.com/1609984.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM