I've installed the Dynamic Languages Toolkit (DLTK) in Eclipse 3.6. But I can't figure out how to create a Ruby file in an existing Java project.
Doing the obvious thing (New -> Empty Ruby Script) just gives the error message "Source folder is not a correct project". Do I have to modify the project in some way to tell DLTK that it's OK to add Ruby files to it?
(Adding the file outside of Eclipse does work.)
Do the following steps (has worked for me):
- Create a java project, or visit an existing one.
- Select in the directory you want the ruby file to live in the menu entry
New file
and enter in the dialog the filename my_file.rb
. The essential part is the extension, because this will ensure that the ruby mechanisms are in place.
- Enter in the new ruby file
def
and press CTRL-SPACE
, you should see as a result the list with def - method definition
(the template), def
and defined?
. This is all part of the ruby text editor.
So it is possible to mix java and ruby files in the same project, that has as nature java. The only thing I has noticed is that the run menu entry only allows you to start the dialog Run As > Run Configurations...
and enter there the necessary parameters to start your ruby script.