When I used maven-compiler-plugin
to add some environment variables, the codes is as following below. It was found that in the bootclasspath, two variables were separated by a semicolon, so an error was reported, as shown in the following figure.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <!-- 1.8 and 1.7 don't matter --> <source>1.7</source> <target>1.7</target> <compilerArguments> <!-- Do not write, only rt.jar by default --> <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath> </compilerArguments> </configuration> </plugin>
Solution
The replacement code is shown below, using ${path.separator}
the semicolon instead. Because under windows
and linux
under, need to use different delimiters. windows
Use a semicolon, linux
use a colon.
<bootclasspath>${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar</bootclasspath>
Similar Posts:
- [Solved] Error: Package com.sun.xml.internal.bind.v2.model.core does not exist
- [Solved] java.lang.NoClassDefFoundError: com/sun/image/codec/jpeg/ImageFormatException (Upload Images Error)
- Maven warnning: ‘build.plugins.plugin.version’ is missing [How to Solve]
- Usage of API documented as @since 1.8+
- [Solved] Dynamic Web Module 3.0 requires Java 1.6 or newer
- How to Solve IDEA maven Error:Perhaps you are running on a JRE rather than a JDK
- Automatic version change of IntelliJ idea language level and Java compiler
- [Solved] SpringBoot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-res
- How does IntelliJ idea use Maven Tomcat plug to run web projects
- Error:java: javacTask: source release 8 requires target release 1.8