Getting RubyMine to recognize JRuby libraries

I setup the proper SDK because all my ruby code will compile but RubyMine complains that
it can't find the any of my java classes? Is this a flaw or is there a way to get it to recognize
where the classes are?

Here is my code, I have underlined all the things its complaining about


require 'java'

include_class 'java.awt.event.ActionListener'
include_class 'javax.swing.JButton'
include_class 'javax.swing.JFrame'

class ClickAction
  include ActionListener

  def action_performed(event)
    puts "Button got clicked."
  end
end



Is there a way around this because I'd love to buy RubyMine if it's able to inform me of what Java
classes and methods I can pick from.

Thanks
1 comment

Hi John,

I setup the proper SDK because all my ruby code will compile but RubyMine complains that
it can't find the any of my java classes? Is this a flaw or is there a way to get it to recognize
where the classes are?

Here is my code, I have underlined all the things its complaining about



require 'java'

include_class 'java.awt.event.ActionListener'
include_class 'javax.swing.JButton'
include_class 'javax.swing.JFrame'

class ClickAction
  include ActionListener

  def action_performed(event)
    puts "Button got clicked."
  end
end



Is there a way around this because I'd love to buy RubyMine if it's able to inform me of what Java
classes and methods I can pick from.

RubyMine doesn't have cross language support with Java, you'd better use IntellIJ IDEA with Ruby plugin for this purposes.
This combination covers all the functionality of RubyMine plus Java-Ruby support (cross language resolve, find usages, refactorings etc).
In RubyMine you can just turn off the inspections for the files which uses Java classes.

Regards,
Oleg

0

Please sign in to leave a comment.