Which JDK do Spring Data modules need to run? - java

My application will be running in a Java 7 JVM. What is the most recent version of Spring-Data-JPA that is compatible with Java 7? Can't find it here or here.

The general baseline of Spring Data modules is JDK 6. However, some of the modules (e.g. Neo4j) required a JDK 7 due to the fact that the store's Java driver already requires JDK 7.

I am using Spring-Data-Jpa 1.8.0 and my application is running ina Java 7 JVM.
If you check the reference for the newest version 1.8.1, you will see that some new features has been added in the favour of java-8 (like the use of Stream but java-7 is still supported.

Related

How would I find which version of jdk is compatible with Grails 3.2.4?

I was given guidance that it would be jdk.1.8.0_31. However, Googling this jdk did not bring up any results. How could I be certain, and where can I find the download? The newest jdk (17.0.2) will not work with it.
For Groovy 2.4 and below I would stick to java 8, I thinks there were some issues with java 11, some fixed in Groovy 2.5, but you will still see warnings. For Grails 5+, Groovy 3 I would go for java 11. I think better support for Java 17 is coming for Groovy 4.
Grails 3.2.4 uses groovy 2.4.7
Grails 4 uses groovy 2.5.6
Grails 5 uses Groovy 3
Groovy 4 is coming "soon" so it's not in Grails yet
Grails 3 is already EOL so I would get on upgrading.
https://objectpartners.com/2015/05/14/list-of-groovy-versions-for-each-version-of-grails/
https://grails.org/blog/2021-01-22-grails-exciting-updates.html#:~:text=Grails%20Framework%20EOL%20Schedule&text=Grails%202%20will%20be%20EOL,EOL%20after%20September%2030th%2C%202021.
https://docs.grails.org/latest/guide/single.html#dependencyUpgrades
You can find and download that build version of jdk 1.8.0_31 here : https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html
It should work with grails 3.2.4.
Grails 3 works with more advanced builds versions of java 8 and more recent versions of java too like java 11.
According to the Grails 3.2.4 guide, Java 7 and above should work.
If you really can't use Java 17, the latest long-term support version, I'd recommend Java 11, the previous long-term support version. You can find downloads for all currently-supported versions of Java here.

Does the Conscrypt library work with Java 11?

Does the Conscrypt library (https://github.com/google/conscrypt), work with Java 11? I know that it supports JDK 8 and 9, but has anyone tried it out with JDK 11? This is needed in a new project I am working on, using Java 11, in which I need to leverage Conscrypt's SSL / TLS features.
It seems this project isn't build on the JPMS.
What this means is, yes, it will work in a Java 11 environment, and it will be "transformed" to an automatic module.
The fact that you state it already works in a Java 9 context make it even more clear it will work in a Java 11 environment too.

Spring 3.2 with Java 7 and Java 8

I have read following questions related to Spring 3.2 and Java 8 compatibility issues but i still have few open questions.
Java 8 Spring compatibility
spring-core 3.2.9 + java 8
Spring 3.2.x with Java 8
Let's say there is an artifact (e.g. DAL) that uses Spring 3.2 and this artifact has to be shared between java 7 service (Service A) and java 8 service ( Service B). These services will compiled and run against respective Java/JVMs.
Now question is - will it be possible to use DAL in both Service-A and Service-B?
As per snippet 1, it should work because Java 8 runtime supports the Spring 3.2 libraries compiled against Java 7 but as per snippet 2 this shouldn't work as Service-B has been complied against java 8 and it is going to use DAL that has been compiled against java 7.
Snippet 1:
However some spring release notes says that the Spring Framework 3.2.x will support deployment on JDK 8 runtimes for applications compiled against JDK 7 (with -target 1.7) or earlier. Note that it won’t support JDK 8’s bytecode format (-target 1.8, as needed for lambdas); please upgrade to Spring Framework 4.0 for that purpose.
Snippet 2:
Versions of the Spring Framework that are older than 4.0M1 do not work with classes that are compiled for Java 8.
There is no point of migrating to Java 8 with Spring 3.x, Its better to move to JDK 1.8 and Spring 4.x. The JDK 8 migration should not be an issue unless the code has to be changed for JDK 8 features.
Spring 3.2.9 will be the best bet in terms of Java 8 byte code support.

Upgrading Project from JDK 6 to JDK 8

My current project is built on Java 6. I'm thinking of upgrading it to Java 8.
Here is the details of the build.properties
xdoclet.home=D:/**/xdoclet-1.2.3
jboss.deploy.dir=D:/**/jboss-6.1.0.Final
application.dir=D:/**/**/cal
middlegen.home=D:/**/middlegen-2.0-b1
compiler.home=C:/Program Files/Java/jdk1.6.0_24/bin/javac .
I've tried building the project on JDK 8 and it is building successfully.
I know that I have to upgrade every libraries so that it can work with JDK 8.
How can I make sure about the dependencies to be correct as there are so many jars? And also Do I have to change my Jboss Application Server to Wildfly Application Server as Jboss AS 7 doesn't support JDK 8?
Please suggest how to approach. Any help appreciated.
And also let me know if it's better to build the project from Scratch in JDK 8 than upgrading it to JDK 8.
1) If you need to use jdk8 than you have to switch too the newer jboss.
2) It is not required to updated all jar's since jdk8 can run older jars
it there is no compatibility problem.
3) If you already have an large probject it is faster to keep it.
4) You can review your code and use the new java 8 features like "<>" and "try()"
For more qualified answer your question is to unspecific.
I would like to suggest you to update JBOSS 6 to wildfly 8 if there is a change required for the updation of JDK 6 to JDK 8.
But there is some other way!!! you can run your JBOSS 6 externally and add the the project.war file in JBOSS>>standalone>>deployment.
For Upgrade of JDK 8,i would suggest to go through JDK 8 feature and see where you can implement the new feature of java in your source code and have a mock testing class for the same.Make sure you have a mock project as it is the good practice for the enhancement of the project.

Can a jar which is compiled on old java version be used in new applications?

We are planning to upgrade our J2EE application, I worked with a lot of jars before and I know that the version mismatch can be a hard problem to debug. We have all the jars(internal to company and built by some other team so cannot recompile with latest version ) compiled using 1.6 jdk and we are bumping up our application version to 1.7, but we are planning to use 1.6 version jars in our app. Does this work well? If not what should I do to make it compatible?
I'm sure that it will work well but, need some expert opinion on this.
Thank yo
As you can see on Oracle's homepage regarding compatibility of Java 1.7 it should be compatibale except for the following things
Binary Compatibility
Java SE 7 is binary-compatible with Java SE 6 except for the
incompatibilities listed below. Except for the noted incompatibilities,
class files built with the Java SE 6 compiler will run correctly in Java SE 7.
Quote from oracle

Categories

Resources