Installing JRuby on Windows Question Set

J

John Miller

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(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_03-b02)
Java HotSpot(TM) 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 Miller
 
K

Knute Johnson

John said:
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(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_03-b02)
Java HotSpot(TM) 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 Miller

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.
 
J

John Miller

Knute said:
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?
 
T

Thomas Enebo

John said:
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
 
C

Charles Oliver Nutter

John said:
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
<jruby dir>/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 said:
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(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_03-b02)
Java HotSpot(TM) 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.
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?)

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.
4) 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
 
R

Ravinder Singroha

Hi All

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

Regards
Ravinder Singroha
 
R

Roger Pack

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?)

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
 
G

Greg Halsey

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(TM) 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
 
C

Charles Oliver Nutter

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:
=C2=A0 =C2=A0jre\bin\server\
=C2=A0 =C2=A0 =C2=A0 =C2=A0On Microsoft Windows platforms, the JDK includ= es both
=C2=A0 =C2=A0 =C2=A0 =C2=A0the Java HotSpot(TM) Server VM and Java HotSpo= t Client VM.
=C2=A0 =C2=A0 =C2=A0 =C2=A0However, the Java SE Runtime Environment for M= icrosoft Windows
=C2=A0 =C2=A0 =C2=A0 =C2=A0platforms includes only the Java HotSpot Clien= t VM. Those
wishing
=C2=A0 =C2=A0 =C2=A0 =C2=A0to use the Java HotSpot Server VM with the Jav= a SE Runtime
=C2=A0 =C2=A0 =C2=A0 =C2=A0Environment may copy the JDK's jre\bin\server = folder to a
=C2=A0 =C2=A0 =C2=A0 =C2=A0bin\server directory in the Java SE Runtime En= vironment.
Software
=C2=A0 =C2=A0 =C2=A0 =C2=A0vendors may redistribute the Java HotSpot Serv= er VM with their
=C2=A0 =C2=A0 =C2=A0 =C2=A0redistributions of the Java SE Runtime Environ=
ment.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top