How do you add a ruby file to an existing project in Eclipse 3.6 using the Dynamic Languages Toolkit (DLTK)?

我的梦境 提交于 2019-12-02 13:50:05

问题


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.)


回答1:


Do the following steps (has worked for me):

  1. Create a java project, or visit an existing one.
  2. 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.
  3. 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.



来源:https://stackoverflow.com/questions/7404716/how-do-you-add-a-ruby-file-to-an-existing-project-in-eclipse-3-6-using-the-dynam

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!