How to setup jruby project to edit and run both java and ruby ?
Answered
I trying to setup Jruby project in Intellij. However after setting up, there is no support for Java source code (there is no Java selection to be added through New screen), and neither just adding the File with Java extension work as it is no autocompletion or java support. The Java support is only available through ruby code. I try adding the facet and module , but it didn't work out either. I am surpise that just creating a project with JRuby does not automatically add Java support out of the box.
What I need is able to edit and run ruby and java code within the same project. What are the steps that I need to do to add java support to existing Jruby project ?
thank
Please sign in to leave a comment.
Create a Java module with source/content roots defined per https://www.jetbrains.com/help/idea/configuring-content-roots.html.
You can then add JRuby facet to this Java module.
Java code will work properly when located in the Source roots (marked in blue).