This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 144567 - Easy JRuby Deployment
Summary: Easy JRuby Deployment
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-20 12:00 UTC by paulf39
Modified: 2011-01-28 20:12 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paulf39 2008-08-20 12:00:12 UTC
Target is Netbeans with JRuby, not JRuby from terminal or command line.
The promise of JRuby/Netbeans I think is that we should be able to write JRuby code in Netbeans, press a button and have
a jar ready to deploy. Following discussion on mail lists it may be possible use F11/Build Button for this purpose. 
http://www.infoq.com/articles/jruby-deployment-with-webstart includes discussion which may be applicable.

Quote:
One of the exciting new features of JRuby 1.1 is the ahead of time (AOT) compilation support. Currently, just in time
compilation in JRuby is restricted to 2048 methods, ahead of time compiling can help to mitigate that restriction.
jrubyc, the JRuby compiler, is still under development, so I'd advise to use the latest JRuby release available.
Compiling a plain Ruby file to a classfile is as simple as invoking the compiler with the script(s) as arguments:

jrubyc rob.rb 

This will create a ruby directory containing a rob.class file. Instead of including the ruby directory into the
jruby.jar as we did above, we're going to create a separate  Jar to hold the application. After all, modifying the
existing Jar doesn't really seem to be such a neat solution. Jars can be made by the tool of the same name:

jar -cfe rob.jar ruby/rob.class ruby 

This will create a small Jar called rob.jar with our class inside, adding the ruby/rob.class as the main-class to be
specified in the Manifest. This allows us to simplify the invocation, as we can now simply point to the class and don't
have to speficy the require on the command line anymore. To execute it, we have to make sure that rob.jar is on the
classpath:

java -Djruby.objectspace.enabled=true -cp rob.jar:jruby.jar ruby.rob
Comment 1 Martin Krauskopf 2008-08-20 12:16:54 UTC
Thanks for filling. I will have to take a look more at JRuby tooling support.

Patches, e.g. Rake task which should be bound to the actions, are welcomed.
Comment 2 loganbarnett 2009-01-02 18:08:53 UTC
Rawr handles some of this, and we (the Rawr developers) would certainly like to help in terms of providing more options
that Netbeans could use (for example, I don't think we can generate a single jar file to distribute. The JRuby jar and
other jars need to be copied along).
http://rawr.rubyforge.org/
Comment 3 Martin Krauskopf 2009-01-06 08:29:16 UTC
Thanks Logan. We'll certainly contact you when we get to this issue. Currently we do not have resources to work on this
due to other must-haves.