The divas talk about the new and cool features of the NetBeans IDE
Insider Scoop From the Tutorial Divas
Archives
« September 2007 »
SunMonTueWedThuFriSat
      
1
2
3
4
5
7
8
9
11
13
14
15
16
18
19
21
22
23
24
25
27
28
29
30
      
Today
XML
Search



Recent Entries


Links

 


Today's Page Hits: 578

Tag Cloud: ajax creator dataprovider dropdown glassfish jasperreports javaone jmaki jruby jsc jsf netbeans photohunt rails ruby table vwp
« Previous day (Sep 11, 2007) | Main | Next day (Sep 13, 2007) »
Wednesday Sep 12, 2007
Native Ruby and JRuby Support in NetBeans IDE 6.0

There is a rumor floating around that the NetBeans IDE Ruby support only works for JRuby. Don't believe it. The IDE makes it very easy to use your own Ruby installation in addition to the bundled JRuby software. As a matter of fact, the first time that you open or create a Ruby project, the IDE looks on your system for other Ruby installations. If it finds any, it pops up a dialog box listing the available installations and lets you choose which one to use.

Using JRuby is just like using Ruby, and you don't have to know anything about Java to use JRuby. You can open your existing Ruby applications for development in the IDE and work with them using the IDE's features regardless of whether you have chosen to use the JRuby interpreter or your native Ruby interpreter. The one exception that I know of is that with JRuby you have to use the ActiveRecord-JDBC adapter if you are using a database server other than MySQL. However, all you have to do is to put the client driver in JRuby's lib folder, make a couple of simple changes to your database.yml, and add a snippet to your environment.rb. Tom Enebro writes about it here. The ActiveRecord-JDBC adapter works with MySQL, Postgresql, Oracle, Derby/Java DB, HQLSDB, and H2 database management systems.

One of the advantages of using JRuby is that you can access Java libraries from your Ruby application. Tor and Cindy put together a great video about this for NetBeans TV.

Another benefit is that you can war up a JRuby application and deploy it to a Java application server, such as GlassFish, just like you would with a Java web application. Arun Gupta has written several blog entries about this and the upcoming Installing and Setting Up Ruby tutorial provides step-by-step instructions for one of the simpler methods of deploying to the GlassFish server. One advantage of deploying to Java application servers is that they are designed to be multi-threaded and thus can handle more than one request at a time. In addition, Java application servers provide tools that make it easier to manage your deployed applications. For detailed information about creating and deploying JRuby applications, see the Rails Integration page on the JRuby wiki.

Posted at 05:46PM Sep 12, 2007 in Ruby  |  http://blogs.sun.com/divas/entry/native_ruby_and_jruby_support  |  Permalink  |  Comments[2]
del.icio.us | furl | simpy | slashdot | technorati | digg