Skip to content

Instantly share code, notes, and snippets.

@CootCraig
Created December 23, 2011 15:17
Show Gist options
  • Save CootCraig/1514450 to your computer and use it in GitHub Desktop.
Save CootCraig/1514450 to your computer and use it in GitHub Desktop.
Multiple JRuby,JDK environments on Windows 7
declare -x JAVA_HOME="c:\\Program Files (x86)\\Java\\jdk1.6.0_29"
$ jruby -v
jruby 1.6.5 (ruby-1.9.2-p136) (2011-10-25 9dcd388) (Java HotSpot(TM) Client VM 1.6.0_29) [Windows 7-x86-java]
Notice "Java HotSpot(TM) Client VM 1.6.0_29"
On my Windows 7 system I have installed 2 versions of JDK:
/c/Program Files (x86)/Java/jdk1.6.0_29
/c/Program Files (x86)/Java/jdk1.7.0_02
/c/Program Files (x86)/Java/jre6
/c/Program Files (x86)/Java/jre7
And 3 version of JRuby:
/c/Program Files (x86)/jruby-1.6.5
/c/Program Files (x86)/jruby-1.6.6.dev
/c/Program Files (x86)/jruby-1.7.0.dev
I did this to try out different environments:
jruby-1.6.5 / jdk1.6.0_29
jruby-1.6.5 / jdk1.7.0_02
jruby-1.6.6.dev / jdk1.7.0_02
jruby-1.7.0.dev / jdk1.7.0_02
I manually set my PATH with these folders:
c:\Program Files (x86)\Java\jdk1.6.0_29\bin;
c:\Program Files (x86)\jruby-1.6.5\bin;
$ echo $JRUBY_OPTS
--1.9
$ jruby -v
jruby 1.6.5 (ruby-1.9.2-p136) (2011-10-25 9dcd388) (Java HotSpot(TM) Client VM 1.7.0_02) [Windows 7-x86-java]
How can I tell what JDK is being used? Is it "Java HotSpot(TM) Client VM 1.7.0_02"?
I find that the gem command is failing:
$ gem list --remote json
*** REMOTE GEMS ***
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
too many connection resets (http://production.s3.rubygems.org/latest_specs.4
.8.gz)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment