Skip to content

Commit fd849f3

Browse files
committed
dep: min java version must be "1.9" for JRuby 10
Github Actions started failing on jruby-head builds this week with an error message like: ``` bad class file: /home/runner/.rubies/jruby-head/lib/jruby.jar(/org/jruby/Ruby.class) class file has wrong version 65.0, should be 61.0 ``` If I understand correctly, the class file version is correlated with the JDK version, so I'm trying this to see if it fixes the issues with jruby-head.
1 parent 3ff6b8e commit fd849f3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

rakelib/extensions.rake

+10-2
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,14 @@ def java?
181181
RUBY_PLATFORM.include?("java")
182182
end
183183

184+
def java_min_version
185+
if java? && JRUBY_VERSION.start_with?("10.")
186+
"1.9"
187+
else
188+
"1.8"
189+
end
190+
end
191+
184192
def add_file_to_gem(relative_source_path)
185193
if relative_source_path.nil? || !File.exist?(relative_source_path)
186194
raise "Cannot find file '#{relative_source_path}'"
@@ -331,8 +339,8 @@ if java?
331339

332340
ext.ext_dir = "ext/java"
333341
ext.lib_dir = "lib/nokogiri"
334-
ext.source_version = "1.8"
335-
ext.target_version = "1.8"
342+
ext.source_version = java_min_version
343+
ext.target_version = java_min_version
336344
ext.classpath = ext.gem_spec.files.select { |path| File.fnmatch?("**/*.jar", path) }.join(":")
337345
ext.debug = true if ENV["JAVA_DEBUG"]
338346
end

0 commit comments

Comments
 (0)