Skip to content
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

Drop Java 8 #488

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Drop Java 8 #488

wants to merge 4 commits into from

Conversation

mkurz
Copy link
Member

@mkurz mkurz commented Sep 29, 2022

No description provided.

Copy link
Member

@cchantep cchantep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really ok with that. There are still project using Java8, and that doesn't have a notable cost for Anorm.

@mkurz
Copy link
Member Author

mkurz commented Sep 29, 2022

Hmm.. We decided to drop Java 8 for Play, see playframework/playframework#11078. The problem is more and more libraries Play depends on are not getting published anymore for Java 8, see https://github.com/playframework/playframework/issues?q=author%3Ascala-steward+label%3Atopic%3Ajdk-next+is%3Aclosed+
Also slick just dropped support for Java 8: slick/slick#2557

I guess, as soon as we publish Play with artifacts that are build with bytecode for Java 11+ you will have a problem with anorm (?) since you depend on Play libraries.
We can wait to merge this here, but in the end I think there will not really be a choice.
I know some projects still use Java 8, but there are no public releases anymore and more projects dropping it already...

},
scalacOptions ++= {
if (scalaBinaryVersion.value != "2.11") {
Seq("-release", "11")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of -target we should use -release, which however is not availabe in Scala 2.11. Bad news is in Scala 2.11 we can not set -target to Java 11:

$ scalac -version
Scala compiler version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL

$ scalac -help
...
-target:<target>   Target platform for object files. All JVM 1.5 targets are deprecated. (jvm-1.5,jvm-1.6,jvm-1.7,jvm-1.8) default:jvm-1.6

So... if we drop Java 8 for anorm... we might also should think about dropping Scala 2.11? The last release was cut 5 years ago...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I would even drop Scala 2.12... build.sbt does lot of conditional stuff to make everyhing work. I think it's time to move on for people. Scala 2.13 has been out for a long time already and it just gets harder and harder to support older Scala and Java releases...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW: I do not se a reason to not set release for Scala 3, should be totally fine.

@ihostage
Copy link
Member

Anorm 2.6.x and 2.7.x still support Java 8, right?
If yes, I think it's a good compromise with the ability to move forward 🚀

@mkurz
Copy link
Member Author

mkurz commented Sep 29, 2022

Anorm 2.6.x and 2.7.x still support Java 8, right?

Yes, I am now just working against the main branch. So there could still be new 2.7.x releases with support for Java 8 (and Scala 2.11)

@@ -371,7 +371,8 @@ lazy val docs = project
libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-jdbc" % playVer.value % Test,
"com.typesafe.play" %% "play-specs2" % playVer.value % Test,
"com.h2database" % "h2" % "1.4.199"
"com.google.inject" % "guice" % "5.1.0" % Test, // TODO: Remove when depending on play-jdbc/-specs2 2.8.x+
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

playVer is 2.6.14.... So need to pull in newer Guice version that works with Java 17... It's only in test scope however. But I think this needs more refactoring...

@mkurz
Copy link
Member Author

mkurz commented Sep 29, 2022

At least the pr is green now. I will convert it to a draft pull request. We can wait to merge it at the very end, after Play has a release with Java 11+ only support.

@mkurz mkurz marked this pull request as draft September 29, 2022 16:48
@cchantep
Copy link
Member

Hmm.. We decided to drop Java 8 for Play, see playframework/playframework#11078. The problem is more and more libraries Play depends on are not getting published anymore for Java 8, see https://github.com/playframework/playframework/issues?q=author%3Ascala-steward+label%3Atopic%3Ajdk-next+is%3Aclosed+ Also slick just dropped support for Java 8: slick/slick#2557

I guess, as soon as we publish Play with artifacts that are build with bytecode for Java 11+ you will have a problem with anorm (?) since you depend on Play libraries. We can wait to merge this here, but in the end I think there will not really be a choice. I know some projects still use Java 8, but there are no public releases anymore and more projects dropping it already...

I'm strongly against that choice.
I would rather cut the dependencies (not many) that would be broken.

@ihostage
Copy link
Member

@cchantep Cedric, are you against with drop support Java 8 for Play or for Anorm?

@mkurz
Copy link
Member Author

mkurz commented Sep 30, 2022

The problem is a lot of people support dropping Java 8 in Play, see playframework/playframework#11078

I would rather cut the dependencies (not many) that would be broken.

This is not possbile, some essential libraries do not publish Java 8 anymore. This is also becoming a security problem if we can not upgrade libraries anymore....
I think we have to realize that it's time to move on... We can not support Java 8 forever.

@cchantep Do you run applications on Java 8? Is it a problem to move to at least Java 11?

@ihostage
Copy link
Member

This is not possbile, some essential libraries do not publish Java 8 anymore. This is also becoming a security problem if we can not upgrade libraries anymore....

Matthias, it's not only with security updates. We needs a new versions of libraries (like Guice) for support a new version of Java (for example 17). And if we want that Play might be work with a new Java versions we must drop support old versions 🤷‍♂️ We can't sit on two chairs at the same time 🤷‍♂️
But of course, Play 2.8 and Anorm 2.6/2.7 can run on Java 8 as now.

@cchantep
Copy link
Member

@ihostage @mkurz Thanks for the feedbacks.

are you against with drop support Java 8 for Play or for Anorm?

I would say both. But much more against for the standalone library like Anorm, Play-JSON and Play-WS, where on one side a compatibility is lost and on this otherwise currently the compatibility is already there with quite no cost.

Do you run applications on Java 8? Is it a problem to move to at least Java 11?

I'm not the only one. I cannot always (unfortunately) chose the JVM version.

We can not support Java 8 forever

As long as enterprise are still deploying Java 8 (and against there is quite no cost to maintain the compatiblity).

If some really one some artifact specifically built for late JVM, then rather add a cross build with a specific artifact name.

With all the community drama the past years, and the drastic impact on Play projects, dropping compatibility really doesn't seem going in the right way for me.

@mkurz
Copy link
Member Author

mkurz commented Sep 30, 2022

It's not always so easy. If we want to support newer Java versions, we probably just have to drop older ones.
For example have a look at playframework/play-doc#155: It is upgrading parboiled to support Java 17. Now, the problem is, only the latest release supports Java 16+, but at the same time dropped support for Java 8, please see: sirthias/parboiled#195 So what should we do now? Such things are happen more and more...
A lot of people asking when will Play finally support Java 17, but basically no one was against dropping Java 8. We announced that along time ago: https://twitter.com/playframework/status/1513823030904082440 (no negative reactions). Also on playframework/playframework#11078 just positive reactions.
Also, we are "just" setting the baseline to Java 11 now. Spring 6 will be much more aggressive and will require Java 17: https://spring.io/blog/2021/09/02/a-java-17-and-jakarta-ee-9-baseline-for-spring-framework-6
And given Spring is the king in the Java world, I think it should be acceptable to finally drop Java 8 in Play.
Actually you are the first one that is really against that change.

@mkurz
Copy link
Member Author

mkurz commented Sep 30, 2022

Plus: You can still keep using Play 2.8.x, we will support it for a while (probably like 6-12 month when Play 2.9 is released. That should give people even more time to upgrade. Java 8 was released 8 years ago now, and probably it will be 9 when we stop support Java 8 in 2.8.x. Java 8 does not even has public updates anymore (do you pay for security fixes)?

@cchantep
Copy link
Member

cchantep commented Oct 5, 2022

It's not always so easy. If we want to support newer Java versions, we probably just have to drop older ones.

We didn't have such issue previously.

For example have a look at playframework/play-doc#155: It is upgrading parboiled to support Java 17.

That's why I would prefer to break this dependency, or as it's only tooling run only doc job in such JVM.

Also on playframework/playframework#11078 just positive reactions.

That's not comparable.
Playframework is a framework, so already comes with more constraints and such update could not be such a big step there.
But in project rather using standalone lib such as anorm or play-json (or play-ws), it's also because more flexibility is required.

Also, we are "just" setting the baseline to Java 11 now. Spring 6 will be much more aggressive and will require Java 17: https://spring.io/blog/2021/09/02/a-java-17-and-jakarta-ee-9-baseline-for-spring-framework-6 And given Spring is the king in the Java world, I think it should be acceptable to finally drop Java 8 in Play. Actually you are the first one that is really against that change.

If the goal is to do another Spring, I'm sorry but then ...

@ihostage
Copy link
Member

ihostage commented Oct 5, 2022

@cchantep Cédric, how do you propose to drop support Java 8 for Play (we already know that we can't don't do that, because we must support Java 17), but still support Java 8 for Anorm? 🤔
If you have a clear plan how to do this, please share it 🙏

@cchantep
Copy link
Member

cchantep commented Oct 6, 2022

Either drop play-doc integration, or run it in a separate CI job.

@gaeljw
Copy link
Member

gaeljw commented Apr 26, 2023

Not sure what's the status about this but definitely agree that we should move on. Many major libraries and frameworks stopped supporting Java 8 (Mockito recently on top of my head). It's also our responsibility as maintainers to incentivize others to move on.

@cchantep
Copy link
Member

It's also our responsibility as maintainers to incentivize others to move on.

No it's not.
Anorm is a standalone library. Not a framework.
It should be as less intrusive as it can, considering the cost.
And there the cost of maintaining compatibility considering the advantage is not in favor of dropping the support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants