Set up NetBeans for Ruby development with JRuby
NetBeans can provide a comfortable Ruby workflow, including project navigation, editing, console output and, in releases with Ruby support, a JRuby platform selector. The important first step is compatibility: not every current Apache NetBeans distribution ships with the older Ruby integration, and a JRuby release must match both the plugin and the installed JDK.
Australian teams may be split across Sydney, Melbourne, Brisbane and Perth. A setup that only works on Unix, assumes US date formats or stores local time in timestamps will cause friction. It should also run on the Windows laptops commonly sold through JB Hi-Fi, Harvey Norman and Officeworks while remaining usable from macOS and Linux.
Check compatibility before installing
Start by opening the plugin manager in the specific NetBeans release you intend to use and searching Available Plugins for Ruby or JRuby. Release notes and the NetBeans Blog home page are useful for identifying older integrations. Plugin availability, menu names and supported runtime versions vary significantly between NetBeans generations.
If Ruby appears, install it, restart the IDE and note its stated JRuby and Java requirements. If it does not appear, do not try to make an unsupported modern release resemble an old one. Use an archived Ruby-enabled NetBeans build in a virtual machine, or retain current NetBeans for Java work and run standalone JRuby through its terminal.
Before standardising the choice, have one developer prove the intended combination on a small branch: editor loading, project creation, gem installation, running and test output. Record the exact NetBeans, JDK and JRuby versions in the project’s setup notes rather than making them assumptions across the organisation.
Install JRuby and register the runtime
Install a standalone JRuby distribution rather than reusing gems installed for MRI Ruby. A plugin designed for JRuby 1.7 will not automatically understand a current 9.x package, and mixing their gem directories can produce confusing load errors. Choose the JRuby build documented for your NetBeans Ruby plugin, or use a supported 9.x release with a maintained integration.
For a native distribution, put its bin directory on PATH and verify the launcher. On Windows the executable may be jruby.bat; on macOS and Linux it is usually jruby.
jruby -v
jruby -S gem env
jruby -S gem install bundler
In NetBeans, open the Ruby options under Tools and Options, choose JRuby as the platform, and point the Ruby home or interpreter field at that installation. Exact labels depend on the plugin version, so use the equivalent platform and interpreter controls. A complete JAR can be a fallback for command-line work, while the native package is easier for gem tooling.
Create a JRuby-backed Ruby project
Choose New Project and the Ruby Application or Ruby Project template, then set the project platform to the registered JRuby runtime. Give the main script a clear name and keep entry-point code small. If the template is unavailable, create a general project and attach the script through a custom Run action.
Use Bundler to make dependencies repeatable. A Gemfile can use the public RubyGems registry as its source and pin compatible releases of rake and minitest. Install them with the same launcher used by NetBeans:
jruby -S bundle install
Keeping -S matters because it asks JRuby to run gem executables in its own environment rather than accidentally selecting MRI Ruby.
First prove the runtime and file paths with a small script that prints its version, working directory and a test result. Projects that combine Ruby orchestration with Python utilities should also exercise subprocess handling early. A Python command-line calculator provides a useful arbitrary-precision target: JRuby can capture its output, errors and exit status rather than treating the utility as a Java class.
Configure a reliable first workflow
Before the first run, check these runtime details:
jruby -vreports the intended version under the same JDK NetBeans uses.- The project properties point to JRuby, not the system MRI Ruby.
- Bundler has installed dependencies under the JRuby gem home.
- Run and test commands work when the terminal starts in the project root.
Keep the repository deliberately small:
GemfileandGemfile.lockdefine dependencies.Rakefilemaps the test task to the project test directory.app.rbcontains the executable entry point.test/contains focused tests that run under JRuby.READMErecords launch, test and environment commands.
A rough first script remains useful—the principle behind awful first posts is to get a complete path working before polishing it. Run the project from NetBeans and inspect the Output window for the JRuby command, arguments and exit status. For a script launched outside the IDE, use jruby -S bundle exec rake test.
Troubleshoot issues and compare runtimes
Common failures are usually environmental: a gem installed under MRI, a Java version mismatch, a missing native extension, proxy settings or a path containing spaces. Check gem env, run the same command in NetBeans and a terminal, and avoid changing several variables at once. Australian deployments also need explicit time handling: Sydney and Melbourne move between AEST and AEDT, Brisbane remains on AEST, Perth uses AWST, and Australian interfaces commonly show DD/MM/YYYY. Store timestamps in UTC and convert them only for display, including when testing in the AWS Sydney ap-southeast-2 region.
JRuby’s JVM access can also connect a Ruby workflow to existing Java services. The companion example on stateful session calls is particularly useful when a Ruby client must preserve session state while invoking an EJB. Keep the Java client and JRuby process on compatible versions and verify cookie handling rather than assuming a stateless HTTP call.
A compact runtime comparison clarifies where each option fits:
| Runtime | Execution model | NetBeans experience | Main advantage | Main limitation |
|---|---|---|---|---|
| MRI Ruby | Native interpreter through external commands | Requires external tooling unless a compatible plugin is available | Fast startup and broad native-gem support | Limited Java interoperability |
| JRuby | Ruby implementation running on the JVM | Ruby-enabled releases can select the platform directly | Direct access to Java libraries and EJBs | JVM startup and stricter native-extension compatibility |
| CPython | Native Python interpreter | Usually managed as an external CLI and dependency environment | Mature automation and scientific packages | Separate runtime and package ecosystem |
The most maintainable NetBeans setup is the one whose plugin, JDK and JRuby versions are documented together. With that combination fixed, developers can edit and run Ruby from the IDE while Bundler, tests and Java interoperability remain reproducible in CI and on Australian workstations.