简体   繁体   English

如何在JRuby Rails应用程序中调试Java代码

[英]How to debug Java code in JRuby rails application

On my rails part I use some Java-code packed into jars, I extract the class in ruby as follows: beanA = self.bean_factory().getBean("BeanA") , where bean_factory connects to the database and set up the spring context. 在我的轨道上,我使用了一些打包入jar的Java代码,按如下方式在ruby中提取类: beanA = self.bean_factory().getBean("BeanA") ,其中bean_factory连接到数据库并设置spring上下文。 The problem is when I'm running the application in debug mode I can't go inside that java object: beanA.method1() while the method invocation itself works OK. 问题是,当我在调试模式下运行应用程序时,无法进入该Java对象: beanA.method1()而方法调用本身可以正常工作。

You will not be able to debug the Java libraries unless your IDE understands Java and the libraries in question were compiled with debug information enabled. 除非您的IDE能够理解Java,并且有问题的库是在启用了调试信息的情况下编译的,否则您将无法调试Java库。 You'd also need to be using an IDE that understood both Ruby and Java, and the only one I can think of that would do this would be IntelliJ with the RubyMine plugin, unless Eclipse now supports Ruby as well. 您还需要使用能够同时理解Ruby和Java的IDE,我唯一想到的将是带有RubyMine插件的IntelliJ,除非Eclipse现在也支持Ruby。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM