Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need Spring version# - only have spring.jar file

Tags:

java

spring

I've inherited an app that uses Spring. The original developers are not available. The Spring jar file is just "spring.jar", so there's no version# in the filename to help me. I'd like to download the Spring source corresponding to the jar file. The MANIFEST.MF file has "Spring-Version: 1.2" however that's not precise enough. I've looked at version 1.2.1 and 1.2.9 and it doesn't match up quite right. The key thing is that org.springframework.web.servlet.view.AbstractCachingViewResolver has a prepareView method which is called from resolveViewName and it does not seem to be in 1.2.1 or 1.2.9.

Is there any easy way to track down the right version?

like image 570
Gary Kephart Avatar asked Jun 03 '09 22:06

Gary Kephart


People also ask

Does Spring 5 need Java 11?

Spring Framework 5.0 had initial support for Java 9, and Spring Framework 5.1 requires JDK 8 and officially supports Java 11. During his keynote Hoeller made it clear that no previous version of the Spring Framework will officially support Java 11 or higher versions.

Which Java version should I use for Spring?

As of Spring Framework 5.1, Spring requires JDK 8+ (Java SE 8+) and provides out-of-the-box support for JDK 11 LTS. Java SE 8 update 60 is suggested as the minimum patch release for Java 8, but it is generally recommended to use a recent patch release.


1 Answers

This will do it:

import org.springframework.core.SpringVersion;  public class VersionChecker {     public static void main(String [] args)     {         System.out.println("version: " + SpringVersion.getVersion());     } } 

Compile and run this with spring.jar in your CLASSPATH and it'll display the version for you. See the javadocs as well.

like image 116
duffymo Avatar answered Oct 23 '22 19:10

duffymo