java: 程序包javax.crypto不存在

it2023-09-11  74

 

1、指定jar路径 注意linux下用:

<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> <configuration> <target>${maven.compiler.target}</target> <source>${maven.compiler.source}</source> <encoding>UTF-8</encoding> <skip>true</skip> <compilerArguments> <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath> </compilerArguments> </configuration> </plugin> </plugins> </build>

2、关于${java.home} 的设定,可以在maven的setting.conf中设定

<profile>         <id>custom-compiler</id>         <properties>             <JAVA8_HOME>C:\Program Files\Java\jdk1.8.0_231</JAVA8_HOME>         </properties>     </profile>

最新回复(0)