-
Notifications
You must be signed in to change notification settings - Fork 217
Use JDK 11 by default #427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Ok, I think I now got a configuration that allows us to make all the different frameworks we are using happy and in harmony on JDK17 (some spotless checks still fail but I'll push a separate commit at the end for this). Now, if everything works as expected, the question is: do we really want to merge this? I'm raising the concern that if we decide to migrate to JDK11 by default and only distribute binaries for this version, any other application or framework that using our API will be forced to migrate to this version as well. We all know that JDK8 is very old and that it's time for Java users to mourn and move forward. Also, since TensorFlow Java has not been "officially" released yet (we are still in alpha mode), we do not need to guarantee forever backward compatibility with Java 8. On the other hand, TensorFlow Java sits very low as a software layer (right above the native code) and therefore its migration will impact a larger audience. Are all our users ready for this migration? Any thoughts? |
If the point of moving to JDK11 is to be able to use new features, I think those are most useful in higher-level API like tensorflow-framework, so what about leaving tensorflow-core on JDK8? We can have different modules use different versions of Java. That way we can still do all the basic things that most applications need to do with JDK8. |
We could benefit using JDK11 for core things as well, like Cleaners for example... I've just recalled that when SIG JVM was created and that we moved the Java code of TF into the new repo that at that time it was supporting Java7 for Android apps and we've decided "Ok that's enough" and we finally could start to write some lambdas that eventually unblocked a few features, like concrete functions. So the core will have to eventually migrate to something higher than JDK8... so the question is maybe more "when" should it do it? |
Well, as you know, I don't think that using Cleaner for anything is a good idea, so... Anything else? Anyway, now that the idiotic lawsuits are over, Google can restart adding more Java features to Android, and they've added Cleaner, so it's not like it works only with JDK8 features: https://developer.android.com/reference/java/lang/ref/Cleaner |
Yeah, I just gave Cleaners as an example of interesting API to try out but I don't expect miracles from it neither. I think most of the interesting stuff for us is in JDK17 and beyond (e.g. the foreign memory access API) and moving to JDK11 would be just a step closer to it (but without reaching it)... @JimClarke5 , @Craigacp , I know we've been talking about this during our last SIG session but can you also share your point of view in this thread? |
My opinion is that there isn't a particularly strong pull to 11, as while there are useful language features for users ( |
Hi @karllessard and @Craigacp Thanks for having this discussion here. For Spark NLP, whenever it comes to deprecating something (Scala, Java, Spark, etc.) in favour of a newer software for more features, maximizing performance, maintainability, security, or even ease of development we have to look at a few things first:
Most of the time, the result is against our wishes. We would love to move entirely to Scala 2.13 on Java 11 today, however, the industry moves very slow. As you can see even the latest runtimes/versions of Databricks, AWS/EMR, even GCP are still supporting Java 8 without giving any EOL for it (at least for Hadoop/Spark clusters). Apache Spark ecosystem itself still supports Java 8 in addition to 11, Databricks had to extend end-of-life for Spark 2.4.x (only uses Java 8) twice from last year to this year. My humble suggestion:
Spark NLP itself cannot stop supporting Java 8 until the end of 2022, but even then we have to wait until Databricks, AWS, Google, and others stop Java 8 support entirely. |
Thanks @maziyarpanahi , I also think that while we are all eager to jump on most recent versions of the JDK, this migration must start from the end users, and buying time until end of 2022 seems also reasonable to me. So, TFJava speaking, we have many options on the table:
Personally I like option 2, it shifts some more maintenance work in our hands but we've already started to provide CVE patches on previous releases anyway. We would probably not merge new features in the 0.4 release branch though. Any thoughts? |
Thanks @karllessard for the understanding. I also personally very much like option 2, in addition to security patches some blocking bugs also can be updated/released in those branches as well, for those who need to wait before moving to a new major TF release and eliminate let's say CUDA 11.x in future. |
All right, that's what we'll do then, this is now merged for 0.5.x and future releases. Thanks everyone! |
As it has been discussed with the SIG, minimal supported JDK version for TF Java will moved from Java8 to Java11. This PR enables JDK11 releases by default, and allows users to build with JDK17 by activating the
jdk17
Maven profile.