Conversation
9.0.0 is the highest version still compatible with java 8.
|
This is related to issue #382, but does not seem to take the discussion into account (nor reference the issue in the description). As it stands, the fix is not backwards compatible and as a drop-in replacement might break existing setups without warning or deprecation path or anything. At very least, such a change should induce a change in maven coordinates, e.g. to |
That is correct - Newer versions do not compile with java 8. jakarta.servlet-api-6.1.0: jakarta.servlet-api-6.0.0: Since Jython targets java 8, there is only a narrow range of external libraries which can be used. I suspect that this range will get even more narrow with the progress of the java ecosystem. |
I would love to offer newer versions of external libraries. But the situation is likely the same as the one for |
I really forgot to reference the issue #382. That is my fault, sorry for that. Please let me explain in a following comment why I think the solutions suggested in #382 are not workable. I need some time to express this the right way. |
|
Alright, thank you for addressing this. I am not sure whether Jython does actually still support Java 8. I vaguely remember that @jeff5 once mentioned the support was dropped. (I used to feel that we should be more explicit about these decisions, but it turned out to be tedious to keep track.) In that case, a newer jakarta.servlet version might be feasible. |
The build files are explicit: |
Maybe it is worth mentioning that the latest released Jython version prevents users from upgrading their own projects to jakarta.
The example of WildFly makes it clear that there can be no hybrid solution (WildFly does not start if there is a reference to the old Given Jython's infrequent releases, this burns down to a documentation issue. That are my thoughts, directed to the future. Of course I know - and respect - that one could see it differently. |
|
Okay, thank you for the explanation. I did not know that |
That's perfectly fine - I start working on this (converting this PR to a draft meanwhile) |
I did not test that, but I am quite convinced that an old WildFly has no knowledge about the later meaning of
Exactly, that could be done. But I really hope that this won't be necessary. |
…servlet Adjust the inline documentation accordingly.
|
Before I push, I use to run the gradle build and the regrtest-ci ant target in a shell with java 8: This is on an Intel Macbook pro running macOS Tahoe 26.3. |
|
Your second comment about Java 8 only appeared in my inbox.
Temurin (by Adoptium) still offers Java 8 for all major platforms. On Mac and ubuntu, I use sdkman (https://sdkman.io/install/) to manage all kinds of Java versions. But I admit that on my company and personal forks, I use to build with Java 21. Which is much faster, by the way. |
|
I deleted the comment because I checked our CI config and found that Java 8 is indeed still tested. Must have mixed-up the situation with Java 7, sorry for the wrong alert. |
|
Okay, I reviewed the changes again and find that |
Done with the last commit.
Yes, I found references in one other .java file.
Me neither. I vaguely remember it being "added on top" in the early days... But if they ever would be resurrected, the packages are right. |
|
Note to whoever reads this discussion: |
|
Perfect, tests pass, changes look good, we're ready to go. Since the next release is not scheduled, I think we have time to let this PR rest for a couple of days before merging, so other devs have a final chance to intervene if there are any concerns (@jeff5 @wfouche @tbpassin). (This is just another safety measure for me since I haven't pushed the merge button on Jython for a while.) If nobody speaks up, I will merge it on next Wednesday/Feb 25th. |
Openlogic has a compatible version of JDK 8+. I was able to build the 2.7.4 version with it. At java 9 and above, there are apparently some changes with how call arguments are handled that caused the build to succeed but the Jython jar file to fail to run in my Tomcat webapp. |
|
Tomcat 9, 10, 11 weren't compiled with the same version of Java. V9 has remained with java 8, but Tomcat v10 is said to have been compiled with java 11; I'm not sure about Tomcat v11. There is also some change in Java v25 that is not always backwards compatible. Different Linux distros provide different java versions through their package managers. All the version mix-and-match differences can make it hard to make a single Jython jar file work for everyone. I think that going forward, the minimum Java version should be 17, or even 21. It won't be backwards compatible for some people, say those who are running Tomcat v9 with Java v8. But their systems have already been working and will continue to work as long the Jython 2.7.4 or earlier jar file remains available. So the easiest approach to the javax/jakarta namespace issue, and the java version issue, seems to be simply to make sure the the current version of the Jython package will continue to be made available along with newer ones. |
|
Issue acknowledged. However, this PR is not the place to address Java version compatibility of Jython as a whole. I think for now it's reasonable to stick to the established compatibility policy. I guess the next release is not too far away and I would not like to break Java 8 compatibility on the last meters. I'd suggest to gradually extend tests to Java 17 and 21, perhaps 25, after Jython 2.7.5 release. Then we'll see. |
The goal is to replace
javax.servletwithjakarta.servlet.Some application containers like WildFly refuse to start up if a
.jarfile on the classpath contains a class in a packagejavax.servlet.This pull request will enable embedding Jython in modern applications.