Skip to content

Commit

Permalink
Support Java 7+.
Browse files Browse the repository at this point in the history
headius committed Feb 12, 2018

Verified

This commit was signed with the committer’s verified signature. The key has expired.
nomadium Miguel Landaeta
1 parent edd18dd commit 7cc201a
Showing 3 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions core/src/main/java/org/jruby/RubyInstanceConfig.java
Original file line number Diff line number Diff line change
@@ -1893,14 +1893,17 @@ public boolean shouldPrecompileAll() {
private static int initGlobalJavaVersion() {
final String specVersion = Options.BYTECODE_VERSION.load();
switch ( specVersion ) {
case "1.6" : return Opcodes.V1_6; // 50
case "1.6" :
throw new UnsupportedClassVersionError("JRuby requires Java 7 or higher");
case "1.7" : return Opcodes.V1_7; // 51
case "1.8" : case "8" : return Opcodes.V1_8; // 52
// NOTE: JDK 9 now returns "9" instead of "1.9"
case "1.9" : case "9" : return Opcodes.V1_8 + 1; // 53
default :
System.err.println("unsupported Java version \"" + specVersion + "\", defaulting to 1.7");
return Opcodes.V1_7;
int version = Integer.parseInt(specVersion);
if (version >= 9) {
return Opcodes.V9;
} else {
throw new UnsupportedClassVersionError("JRuby requires Java 7 or higher");
}
}
}

2 changes: 1 addition & 1 deletion pom.rb
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@

'jruby-launcher.version' => '1.1.1',
'ant.version' => '1.9.2',
'asm.version' => '5.0.4',
'asm.version' => '6.0',
'jffi.version' => '1.2.16',
'joda.time.version' => '2.8.2' )

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -115,7 +115,7 @@ DO NOT MODIFIY - GENERATED CODE
<rake.version>10.4.2</rake.version>
<jruby-launcher.version>1.1.1</jruby-launcher.version>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<asm.version>5.0.4</asm.version>
<asm.version>6.0</asm.version>
<rspec-expectations.version>3.4.0</rspec-expectations.version>
<its.osgi>osgi*/pom.xml</its.osgi>
<base.javac.version>1.7</base.javac.version>

0 comments on commit 7cc201a

Please sign in to comment.