Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Trevor Menagh authored and Dave Syer committed Mar 17, 2014
1 parent 16d4214 commit b8c4720
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
26 changes: 25 additions & 1 deletion spring-boot-tools/spring-boot-loader-tools/pom.xml
Expand Up @@ -11,14 +11,38 @@
<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>
<groupId>com.sun</groupId>
<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>
Expand Down
29 changes: 29 additions & 0 deletions spring-boot-tools/spring-boot-maven-plugin/pom.xml
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit b8c4720

Please sign in to comment.