Installing JRuby on Windows Question Set

Greetings All,

I have concluded that I ought to try out JRuby. Running on windows I
get the short end of the stick when it comes to non-ruby-native
functionality, and there is an AI package in Java that I want to play
with in a language that doesn’t require a novel worth of code to use. I
have a few questions about how to make this happen:

  1. What is the best way to get MRI and JRuby to live on the same
    (Windows) system? The only answer I’ve found to this question involves
    bash scripts.

  2. What do I need to get in terms of a Java Environment. below is the
    output of Java -version:
    java version “1.4.1_03”
    Java™ 2 Runtime Environment, Standard Edition (build 1.4.1_03-b02)
    Java HotSpot™ Client VM (build 1.4.1_03-b02, mixed mode)
    This was likely installed at least 3 years ago, and is probably out of
    date. I went to java.sun.com to look for “the latest version” and hit
    buzzword central. The last time I did anything more then run a Java App
    was 6+ years ago and I’m now lost in all the new Lingo. So, what to I
    need to run JRuby, and what else outh I get to make Rails work with it?

  3. Is is possible to “move” my installed gems from MRI Ruby1.8.6 to
    JRuby without having to touch the network. All I have is a 56.6k modem,
    and Downloading rails again is a 4 hour job. (BTW: Is there a way in
    general to download a gem and not install it? For example could I get
    the latest Rails release on my Laptop at work and bring the files home
    to install on the desktop?)

  4. What does it take to get SQLite or some equivalent no configuration
    database running in JRuby?

Thanks for the help.

John M.

John M. wrote:

bash scripts.
need to run JRuby, and what else outh I get to make Rails work with it?

Thanks for the help.

John M.

I can answer the Java questions for you if you answer one for me, do you
need the compiler too? In either case go to java.sun.com and on the
right side there is a heading that says, “Popular Downloads”, under that
select “Java SE”. On the page it takes you to, select either JDK 6
Update 3 (if you need the compiler) or Java Runtime Environment (JRE) 6
Update 3. On the down load page, click the Accept License Agreement
button and download the Windows Offline Installation. Clicking on the
silly check box to the left gets you nowhere so click on the hyperlink.
You can uninstall you current version first if you want but it is not
required. There will be a couple of directories left in C:\Program
Files\Java and you can delete those or just leave them. If you don’t
need the compiler the download is much smaller.

Knute Johnson
email s/nospam/knute/

Knute Johnson wrote:

John M. wrote:

bash scripts.
need to run JRuby, and what else outh I get to make Rails work with it?

Thanks for the help.

John M.

I can answer the Java questions for you if you answer one for me, do you
need the compiler too?

Do I need a compiler to require .jar files in JRuby?

John M. wrote:

I can answer the Java questions for you if you answer one for me, do you
need the compiler too?

Do I need a compiler to require .jar files in JRuby?

You only need the compiler if you want to build JRuby from source.

One other answer to your original thread…I like to have MRI (C
version of Ruby) higher in my path than JRuby. Then I make heavy use of
the ‘-S’ option of Ruby to do things between the two implementations:

jruby -S gem install rails
ruby -S gem install rails
jruby -S rails

One other commonly asked next question is can you share gem
installations. The answer is no since some gems have native extensions
(e.g. you install platform specific mongrel gems).

-Tom

John M. wrote:

Greetings All,

I have concluded that I ought to try out JRuby. Running on windows I
get the short end of the stick when it comes to non-ruby-native
functionality, and there is an AI package in Java that I want to play
with in a language that doesn’t require a novel worth of code to use. I
have a few questions about how to make this happen:

I’m late to the party on this one, but here’s some answers.

  1. What is the best way to get MRI and JRuby to live on the same
    (Windows) system? The only answer I’ve found to this question involves
    bash scripts.

Generally, JRuby lives entirely within its unpacked directory. Run
/bin/jruby and it will handle the rest. If you add JRuby’s
bin dir to your path, you can just run “jruby”. If you add it after your
Ruby path, and want to make sure you’re running ‘gem’, or ‘rails’ or
other scripts with JRuby, use "jruby -S ".

  1. What do I need to get in terms of a Java Environment. below is the
    output of Java -version:
    java version “1.4.1_03”
    Java™ 2 Runtime Environment, Standard Edition (build 1.4.1_03-b02)
    Java HotSpot™ Client VM (build 1.4.1_03-b02, mixed mode)
    This was likely installed at least 3 years ago, and is probably out of
    date. I went to java.sun.com to look for “the latest version” and hit
    buzzword central. The last time I did anything more then run a Java App
    was 6+ years ago and I’m now lost in all the new Lingo. So, what to I
    need to run JRuby, and what else outh I get to make Rails work with it?

JRuby 1.1+ requires at least Java 5, but Java 6 (Java SE 6, someone else
posted info on how to download) will provide the best performance.
Install it and that should be all you need.

Unless you’re going to compile Java code, you don’t need the compiler.
JRuby’s compiler is self-contained.

  1. Is is possible to “move” my installed gems from MRI Ruby1.8.6 to
    JRuby without having to touch the network. All I have is a 56.6k modem,
    and Downloading rails again is a 4 hour job. (BTW: Is there a way in
    general to download a gem and not install it? For example could I get
    the latest Rails release on my Laptop at work and bring the files home
    to install on the desktop?)

Well for Rails, you shouldn’t have any problems. Rails installs the same
gems under any Ruby implementation, so your already-downloaded gems
(under lib/ruby/gems/1.8/cache) can be installed in JRuby. I don’t know
of a way to just fetch a gem and not install.

  1. What does it take to get SQLite or some equivalent no configuration
    database running in JRuby?

Your best bet would be a database like Derby/JavaDB, which is a
pure-Java embedded database. Using JavaDB, you could produce a DB-driven
app very quickly, and since it’s Java the whole app could be packaged up
and moved to another machine and run just as well. If you’re using
ActiveRecord, there are gems for derby and other databases. If you’re
not using ActiveRecord, it would probably be easiest to just call JDBC
APIs directly. There are blog posts and wiki articles out there that
show how to directly use JDBC from Ruby with JRuby.

Do check out the JRuby Wiki at http://wiki.jruby.org and feel free to
join the mailing lists or find us on #jruby on Freenode IRC.

  • Charlie

On Thu, Jul 9, 2009 at 6:46 AM, Ravinder
Singroha[email protected] wrote:

Hi All

Can any body tell me how to install JRUBY on Windows ?

Download, unpack, set PATH…that’s about it. Here’s a walkthrough:

http://kenai.com/projects/jruby/pages/GettingStarted#Microsoft_Windows_XP_Installation_Example

We’d love to have someone contribute an installer though, since I know
fiddling with environment variables on Windows is rather cumbersome.

  • Charlie

Hi All

Can any body tell me how to install JRUBY on Windows ?

Regards
Ravinder Singroha

Charles Oliver N. wrote:

John M. wrote:

Greetings All,

I have concluded that I ought to try out JRuby. Running on windows I
get the short end of the stick when it comes to non-ruby-native
functionality, and there is an AI package in Java that I want to play
with in a language that doesn’t require a novel worth of code to use. I
have a few questions about how to make this happen:

I’m late to the party on this one, but here’s some answers.

  1. What is the best way to get MRI and JRuby to live on the same
    (Windows) system? The only answer I’ve found to this question involves
    bash scripts.

Generally, JRuby lives entirely within its unpacked directory. Run
/bin/jruby and it will handle the rest. If you add JRuby’s
bin dir to your path, you can just run “jruby”. If you add it after your
Ruby path, and want to make sure you’re running ‘gem’, or ‘rails’ or
other scripts with JRuby, use "jruby -S ".

  1. What do I need to get in terms of a Java Environment. below is the
    output of Java -version:
    java version “1.4.1_03”
    Java™ 2 Runtime Environment, Standard Edition (build 1.4.1_03-b02)
    Java HotSpot™ Client VM (build 1.4.1_03-b02, mixed mode)
    This was likely installed at least 3 years ago, and is probably out of
    date. I went to java.sun.com to look for “the latest version” and hit
    buzzword central. The last time I did anything more then run a Java App
    was 6+ years ago and I’m now lost in all the new Lingo. So, what to I
    need to run JRuby, and what else outh I get to make Rails work with it?

JRuby 1.1+ requires at least Java 5, but Java 6 (Java SE 6, someone else
posted info on how to download) will provide the best performance.
Install it and that should be all you need.

Unless you’re going to compile Java code, you don’t need the compiler.
JRuby’s compiler is self-contained.

  1. Is is possible to “move” my installed gems from MRI Ruby1.8.6 to
    JRuby without having to touch the network. All I have is a 56.6k modem,
    and Downloading rails again is a 4 hour job. (BTW: Is there a way in
    general to download a gem and not install it? For example could I get
    the latest Rails release on my Laptop at work and bring the files home
    to install on the desktop?)

Well for Rails, you shouldn’t have any problems. Rails installs the same
gems under any Ruby implementation, so your already-downloaded gems
(under lib/ruby/gems/1.8/cache) can be installed in JRuby. I don’t know
of a way to just fetch a gem and not install.

  1. What does it take to get SQLite or some equivalent no configuration
    database running in JRuby?

Your best bet would be a database like Derby/JavaDB, which is a
pure-Java embedded database. Using JavaDB, you could produce a DB-driven
app very quickly, and since it’s Java the whole app could be packaged up
and moved to another machine and run just as well. If you’re using
ActiveRecord, there are gems for derby and other databases. If you’re
not using ActiveRecord, it would probably be easiest to just call JDBC
APIs directly. There are blog posts and wiki articles out there that
show how to directly use JDBC from Ruby with JRuby.

Do check out the JRuby Wiki at http://wiki.jruby.org and feel free to
join the mailing lists or find us on #jruby on Freenode IRC.

  • Charlie
  1. Is is possible to “move” my installed gems from MRI Ruby1.8.6 to
    JRuby without having to touch the network. All I have is a 56.6k modem,
    and Downloading rails again is a 4 hour job. (BTW: Is there a way in
    general to download a gem and not install it? For example could I get
    the latest Rails release on my Laptop at work and bring the files home
    to install on the desktop?)

install of doing a gem install you could do
gem fetch gem_name
then
gem install gem_name.gem
jruby\bin\gem install

Also the “pik” gem might be useful for you if you like going between
ruby implementations a lot.
http://github.com/vertiginous/pik/tree/master
GL!
=r

On Fri, Jul 10, 2009 at 8:50 AM, Greg H.[email protected] wrote:

    platforms includes only the Java HotSpot Client VM. Those
wishing
    to use the Java HotSpot Server VM with the Java SE Runtime
    Environment may copy the JDK’s jre\bin\server folder to a
    bin\server directory in the Java SE Runtime Environment.
Software
    vendors may redistribute the Java HotSpot Server VM with their
    redistributions of the Java SE Runtime Environment.

Ahh yes, that’s a great call. On all other platforms, I believe the
JRE comes with the server VM as well. There are efforts to merge
server and client, but this is definitely something we should have in
the wiki, maybe on one of the FAQ pages. Can you add something?

  • Charlie

Charlie thank you and everyone who contributed to making JRuby a
reality.

My 2 cents:
I was trying to use the server option and it didn’t work.
Here is answer from the readme:
jre\bin\server
On Microsoft Windows platforms, the JDK includes both
the Java HotSpot™ Server VM and Java HotSpot Client VM.
However, the Java SE Runtime Environment for Microsoft Windows
platforms includes only the Java HotSpot Client VM. Those
wishing
to use the Java HotSpot Server VM with the Java SE Runtime
Environment may copy the JDK’s jre\bin\server folder to a
bin\server directory in the Java SE Runtime Environment.
Software
vendors may redistribute the Java HotSpot Server VM with their
redistributions of the Java SE Runtime Environment.

The path might look something like C:\Program Files\Java\jre6\bin
thanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs