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

jruby can't be used w/ jdk 9 #2077

Closed
iignatev opened this Issue Oct 29, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@iignatev
Copy link
Contributor

iignatev commented Oct 29, 2014

$ java -showversion -jar ./lib/jruby.jar -e "puts 'test'"
java version "1.9.0-ea-fastdebug"
Java(TM) SE Runtime Environment (build 1.9.0-ea-fastdebug-b36)
Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-fastdebug-b36, mixed mode)

Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.jruby.Main.<init>(Main.java:99)
        at org.jruby.Main.main(Main.java:193)
Caused by: java.lang.RuntimeException: unsupported Java version: 1.9
        at org.jruby.RubyInstanceConfig.initGlobalJavaVersion(RubyInstanceConfig.java:1858)
        at org.jruby.RubyInstanceConfig.<clinit>(RubyInstanceConfig.java:1608)
        ... 2 more

suggested fix:

diff --git a/core/src/main/java/org/jruby/RubyInstanceConfig.java b/core/src/main/java/org/jruby/RubyInstanceConfig.java
index 21ebfc5..a4c304b 100644
--- a/core/src/main/java/org/jruby/RubyInstanceConfig.java
+++ b/core/src/main/java/org/jruby/RubyInstanceConfig.java
@@ -1774,7 +1774,7 @@ public class RubyInstanceConfig {
            return Opcodes.V1_5;
         } else if (specVersion.equals("1.6")) {
             return Opcodes.V1_6;
-        } else if (specVersion.equals("1.7") || specVersion.equals("1.8")) {
+        } else if (specVersion.equals("1.7") || specVersion.equals("1.8") || specVersion.equals("1.9")) {
             return Opcodes.V1_7;
         } else {
             throw new RuntimeException("unsupported Java version: " + specVersion);
@iignatev

This comment has been minimized.

Copy link
Contributor Author

iignatev commented Oct 29, 2014

w/ fix:

$ java -showversion -jar ./lib/jruby.jar -e "puts 'test'"
java version "1.9.0-ea-fastdebug"
Java(TM) SE Runtime Environment (build 1.9.0-ea-fastdebug-b36)
Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-fastdebug-b36, mixed mode)

test
@headius

This comment has been minimized.

Copy link
Member

headius commented Oct 29, 2014

Oopsie, usually we're good about getting the new JVM versions added. I'll make this check a bit more open-ended.

headius added a commit that referenced this issue Oct 29, 2014

@headius

This comment has been minimized.

Copy link
Member

headius commented Oct 31, 2014

Will be in next JRuby 1.7 and in 9000.

@headius headius closed this Oct 31, 2014

@enebo enebo added this to the JRuby 1.7.17 milestone Nov 3, 2014

yousuketto added a commit to yousuketto/jruby that referenced this issue Nov 22, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.