Jruby 1.7.0 not defaulting to 1.9 mode on win7

JRuby 1.7.0 appears to be defaulting to 1.8 mode on my Win7 32bit
system, but not my Arch system.

C:\Users\Jon>set j
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_07
JRE_HOME=C:\Program Files\Java\jre7

C:\Users\Jon>jruby --version
jruby 1.7.0 (ruby-1.8.7p370) 2012-10-22 ff1ebbe on Java HotSpot™
Client VM 1.7.0_07-b10 [Windows 7-x86]

C:\Users\Jon>jruby -ve “h={a: 1, b: 2}; p h”
jruby 1.7.0 (ruby-1.8.7p370) 2012-10-22 ff1ebbe on Java HotSpot™
Client VM 1.7.0_07-b10 [Windows 7-x86]
SyntaxError: -e:1: syntax error, unexpected ‘:’

h={a: 1, b: 2}; p h
^

C:\Users\Jon>jruby --1.9 -ve “h={a: 1, b: 2}; p h”
jruby 1.7.0 (1.9.3p203) 2012-10-22 ff1ebbe on Java HotSpot™ Client VM
1.7.0_07-b10 [Windows 7-x86]
{:a=>1, :b=>2}

I’m not familiar with the JRuby source, but this all looks fine

https://github.com/jruby/jruby/blob/master/default.build.properties#L108
https://github.com/jruby/jruby/blob/master/src/org/jruby/runtime/Constants.java#L88-100
https://github.com/jruby/jruby/blob/master/src/org/jruby/util/cli/OutputStrings.java#L115-150
https://github.com/jruby/jruby/blob/master/src/org/jruby/RubyInstanceConfig.java#L86-87
https://github.com/jruby/jruby/blob/master/src/org/jruby/util/cli/Options.java#L128

so it’s something deeper I haven’t yet found.

Can any other JRuby on Windows users repro?

Jon


Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat.
http://thecodeshop.github.com | http://jonforums.github.com/
twitter: @jonforums

On Mon, Oct 22, 2012 at 2:24 PM, Jon [email protected] wrote:

JRuby 1.7.0 appears to be defaulting to 1.8 mode on my Win7 32bit system, but
not my Arch system.

C:\Users\Jon>set j
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_07
JRE_HOME=C:\Program Files\Java\jre7

C:\Users\Jon>jruby --version
jruby 1.7.0 (ruby-1.8.7p370) 2012-10-22 ff1ebbe on Java HotSpot™ Client VM
1.7.0_07-b10 [Windows 7-x86]

This is very peculiar. The only possible thing in JRuby that could
cause it would be a bug/flaw in the native jruby.exe executable we
ship. However, that executable is the same code we use for the
jruby-launcher gem, which works fine.

My first guess would be that there’s an environment variable set
somewhere forcing your system to run in 1.8 mode…or a .jrubyrc
somewhere doing the same. Can you look into that?

  • Charlie

cause it would be a bug/flaw in the native jruby.exe executable we
ship. However, that executable is the same code we use for the
jruby-launcher gem, which works fine.

My first guess would be that there’s an environment variable set
somewhere forcing your system to run in 1.8 mode…or a .jrubyrc
somewhere doing the same. Can you look into that?

The set j shows I nuked the old JRUBY_OPTS env var…but…oh hell,
forgot to retire the dusty %USERPROFILE%.jrubyrc containing
compat.version = 1.8. Sigh, all’s well.

Sorry for the noise.

Thanks, Jon