Make Spring Boot work in Java 1.6 on Mac OS X

Currently Spring Boot fails in Java 1.6 on Mac OS X due to the
"tools.jar" being integrated into classes.jar in the Apple version of
Java 6.

Apple fixed this with Java 7, but we should still support Java 6. We had
to roll back to maven-plugin-plugin 3.1 to make this work with Java 6
and 7.

All tests pass with Java 6 and Java 7.
pull/508/head
Trevor Menagh 11 years ago committed by Dave Syer
parent 16d4214f56
commit b8c472007a

@ -11,6 +11,30 @@
<properties>
<main.basedir>${basedir}/../..</main.basedir>
</properties>
<profiles>
<profile>
<id>standard-jdk</id>
<activation>
<file>
<exists>${java.home}/../lib/tools.jar</exists>
</file>
</activation>
<properties>
<tools-jar>${java.home}/../lib/tools.jar</tools-jar>
</properties>
</profile>
<profile>
<id>apple-jdk</id>
<activation>
<file>
<exists>${java.home}/../Classes/classes.jar</exists>
</file>
</activation>
<properties>
<tools-jar>${java.home}/../Classes/classes.jar</tools-jar>
</properties>
</profile>
</profiles>
<dependencies>
<!-- Compile -->
<dependency>
@ -18,7 +42,7 @@
<artifactId>tools</artifactId>
<version>${java.version}</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
<systemPath>${tools-jar}</systemPath>
</dependency>
<dependency>
<groupId>org.springframework</groupId>

@ -12,6 +12,28 @@
<main.basedir>${basedir}/../..</main.basedir>
</properties>
<profiles>
<profile>
<id>standard-jdk</id>
<activation>
<file>
<exists>${java.home}/../lib/tools.jar</exists>
</file>
</activation>
<properties>
<tools-jar>${java.home}/../lib/tools.jar</tools-jar>
</properties>
</profile>
<profile>
<id>apple-jdk</id>
<activation>
<file>
<exists>${java.home}/../Classes/classes.jar</exists>
</file>
</activation>
<properties>
<tools-jar>${java.home}/../Classes/classes.jar</tools-jar>
</properties>
</profile>
<profile>
<id>integration</id>
<activation>
@ -46,6 +68,13 @@
</profiles>
<dependencies>
<!-- Compile -->
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>${java.version}</version>
<scope>system</scope>
<systemPath>${tools-jar}</systemPath>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-boot-loader-tools</artifactId>

Loading…
Cancel
Save