-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
fix java 8 compatibility #292
Conversation
This looks okay to me in principle, however, please educate me. What is Java 1.8? What is Java 8? Is Java 1.8, 7 major versions less than Java 8? Is this just setting the minimum required "interface" version to something a little more recent? Is Java 8 a reasonable minimum if that's the case? |
no, Java 1.8 is actually equal to Java 8 - it's just a historical versioning scheme kept for compatibility since Java ever existed :) Java 8 (which is 10 years old) is the reasonable minimum. JRuby and Puma (except EOL versions) do support Java 8+ as well. Is this just setting the minimum required "interface" version to something a little more recent? typical situations are: --release flag ensures that you can safely compile the gem with any recent JDK without breaking compatibility with previous Java versions. |
this allows using ``` Rake::JavaExtensionTask.new("name", gemspec) do |ext| ext.release = '8' end ``` on Java 8 (for building the gem), because the flag is available since Java 9, see https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html this flag is for backward compatibility, so it's safe to just skip it if we can't use it. relates to puma/puma#3109 socketry/nio4r#292
I've rebased this branch on main. |
It seems like macOS jruby doesn't like this new flag? |
macOS 11 still uses Java 8 by default, but the compatibility flag is available since Java 9 (the resulting binary remains Java 8 compatible) we could use macOS 12 instead which has a newer version I think... Or skip the test until there's an official release of rake-compiler/rake-compiler#213 |
I'm fine with just using the newer version. |
JFYI, GitHub Actions macOS 12 image is setup with the following:
Don't know about standard macOS... |
thanks @MSP-Greg , so we can just switch the JAVA_HOME to the right version like https://github.com/puma/puma/blob/master/.github/workflows/tests.yaml#L154 ? |
LGTM |
see https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/
related to puma/puma#3109
Types of Changes
Contribution