程序包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

posted @ 2021-02-19 21:02  LANGKYE#  阅读(1499)  评论(0编辑  收藏  举报