Forum: JRuby jruby 1.7.0 not defaulting to 1.9 mode on win7

Posted by Jon Forums (jonm)
on 2012-10-22 21:25
(Received via mailing list)
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(TM) 
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(TM) 
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(TM) 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...
  https://github.com/jruby/jruby/blob/master/src/org...
  https://github.com/jruby/jruby/blob/master/src/org...
  https://github.com/jruby/jruby/blob/master/src/org...
  https://github.com/jruby/jruby/blob/master/src/org...

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
Posted by Charles Nutter (headius)
on 2012-10-22 22:17
(Received via mailing list)
On Mon, Oct 22, 2012 at 2:24 PM, Jon <jon.forums@gmail.com> 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(TM) 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
Posted by Jon Forums (jonm)
on 2012-10-23 00:38
(Received via mailing list)
> 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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.