Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot for older version of java

Tags:

spring-boot

I am looking to create a new web application using spring boot. Unfortunately my server is fairly locked down in terms of the technology stack. It has java 5 installed on it.

Can anyone tell me whether spring boot can run on java 1.5 and what version?

thanks

like image 471
Richie Avatar asked Aug 25 '16 04:08

Richie


People also ask

Can we use Java 1.7 for spring boot?

Although you can use Spring Boot with Java 6 or 7, we generally recommend Java 8 if at all possible.

Is Spring 5 compatible with older versions of Java?

Spring 5 supports Java EE 7 and also compatible with Java EE 8. So we can use Servlet 4.0, Bean Validation 2.0, JPA 2.2 in our applications. We can also use their older versions i.e. Servlet 3.1, Bean Validation 1.1, JPA 2.1. Spring 5 applications preferred server versions are Tomcat 8.5+, Jetty 9.4+ and WildFly 10+.

What is the minimum Java version need for spring boot?

Spring Boot 2.7. 4 requires Java 8 and is compatible up to and including Java 19.

Is spring boot compatible with Java 11?

Spring Boot 2.7. 1 (and therefore the latest Spring Framework 5.3. 22) supports Java 17 while also remaining compatible with Java 11 and 8.


2 Answers

Since Spring boot 1.0.0, the minimal requirement to run a Spring boot application has been Java 6. This can also be found in the reference guide of Spring boot 1.0.0:

Spring Boot can be used with “classic” Java development tools or installed as a command line tool. Regardless, you will need Java SDK v1.6 or higher.

Support for older Java versions has been dropped throughout releases, with Spring boot 1.3 moving to Java 7 as a baseline (still possible to use Java 6 with additional configuration) and Spring boot 2.x moving to Java 8 as a baseline. Additionally to what the documentation says, none of the Spring boot 1.x versions support Java 9 or higher.

Summarized:

  • 1.0.0: Support from Java 6 - 8
  • 1.3.0: Support from Java 7 - 8, additional configuration for Java 6 required
  • 2.0.0: Support from Java 8 - ...

So, the answer is that it's not possible to run in Java 5.

like image 58
g00glen00b Avatar answered Nov 12 '22 12:11

g00glen00b


For Spring Boot 2.0, the requirement is Java 8 as a minimum version.

From the Spring Boot 2.0 release notes :

Spring Boot 2.0 requires Java 8 as a minimum version. Many existing APIs have been updated to take advantage of Java 8 features such as: default methods on interfaces, functional callbacks, and new APIs such as javax.time. If you are currently using Java 7 or earlier, you’ll need to upgrade your JDK before you can develop Spring Boot 2.0 applications.

like image 29
davidxxx Avatar answered Nov 12 '22 12:11

davidxxx