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>