From f96adaf3acb11de99382b142a5f9fa0dd5a3d3c9 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 22 Jan 2015 16:45:46 +0000 Subject: [PATCH] Add some documentation about Java 6 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document the need to use a different JTA 1.2 API jar and Tomcat 7 or Jetty 8 if you’re running on Java 6. Closes gh-2347 --- .../src/main/asciidoc/getting-started.adoc | 9 +++--- spring-boot-docs/src/main/asciidoc/howto.adoc | 31 ++++++++++++++++++- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/getting-started.adoc b/spring-boot-docs/src/main/asciidoc/getting-started.adoc index 7974ce4d7d0..7d7b7de35a6 100644 --- a/spring-boot-docs/src/main/asciidoc/getting-started.adoc +++ b/spring-boot-docs/src/main/asciidoc/getting-started.adoc @@ -36,11 +36,12 @@ diverge from the defaults. [[getting-started-system-requirements]] == System Requirements -Spring Boot {spring-boot-version} requires http://www.java.com[Java 6] and Spring -Framework 4.1.3 or above. Explicit build support is provided for Maven (3.2+) and -Gradle (1.12+). +By default, Spring Boot {spring-boot-version} requires http://www.java.com[Java 7] and +Spring Framework 4.1.3 or above. You can use Spring Boot with Java 6 with some additional +configuration. See <> for more details. Explicit build support +is provided for Maven (3.2+) and Gradle (1.12+). -TIP: Although you can use Spring Boot with Java 6, we generally recommend Java 8 if at +TIP: Although you can use Spring Boot with Java 6 or 7, we generally recommend Java 8 if at all possible. === Servlet containers diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index 62f34024019..279744a30ba 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -2201,6 +2201,35 @@ after which you can run the application with +[[howto-use-java-6]] +=== How to use Java 6 +If you want to use Spring Boot with Java 6 there are a small number of configuration +changes that you will have to make. The exact changes depend on your application's +functionality. + + + +[[howto-use-java-6-embedded-container]] +==== Embedded servlet container compatibility + +If you are using one of Boot's embedded Servlet containers you will have to use a +Java 6-compatible container. Both Tomcat 7 and Jetty 8 are Java 6 compatible. See +<> and <> for details. + + + +[[how-to-use-java-6-jta-api]] +==== JTA API compatibility + +While the Java Transaction API itself doesn't require Java 7 the official API jar +contains classes that have been built to require Java 7. If you are using JTA then +you will need to replace the official JTA 1.2 API jar with one that has been built +to work on Java 6. To do so, exclude any transitive dependencies on +`javax.transaction:javax.transaction-api` and replace them with a dependency on +`org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Final` + + + [[howto-traditional-deployment]] == Traditional deployment @@ -2423,4 +2452,4 @@ but the rest of it is normal for a Spring application in Servlet 2.5. Example: In this example we are using a single application context (the one created by the context listener) and attaching it to the `DispatcherServlet` using an init parameter. This is -normal in a Spring Boot application (you normally only have one application context). +normal in a Spring Boot application (you normally only have one application context). \ No newline at end of file