arton / rjb

Ruby Java Bridge
https://www.artonx.org/collabo/backyard/?RubyJavaBridge
GNU Lesser General Public License v2.1
117 stars 34 forks source link

Failing to load Rjb #39

Closed dtrce closed 8 years ago

dtrce commented 8 years ago

I'm trying to use jasper reports with rails but it seems to be failing at this line:

Rjb::load( classpath, ['-Djava.awt.headless=true','-Xms128M', '-Xmx256M'] )

I'm on Mac El Cap running Java 8. Based on your guide, JAVA_HOME should be pointed to the versions in /System/Library/Frameworks/JavaVM.framework/Libraries/ but I do not have Libraries directory.

arton commented 8 years ago

Sorry for your nconvenience

You might read bit old document. Current version of Rjb automatically points correct Java if it runs on OSX. If you could have some interesting, you may find it in rjb.rb calling '/usr/libexec/java_home'. Therefore, you should let JAVA_HOME empty.

I'll fix the doucment that you read. I wonder if you could point the document. Thank you for your cooperation.

dtrce commented 8 years ago

I still got the same error after unsetting the JAVA_HOME env variable.

arton commented 8 years ago

What is showing on your terminal ? /usr/libexec/java_home and ls (back quote)/usr/libexec/java_home(back quote(back quote)

dtrce commented 8 years ago

/usr/libexec/java_home -> /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home

ls /usr/libexec/java_home -> /usr/libexec/java_home

arton commented 8 years ago

No. you should put backquote before and after /usr/libexec/java_home. Github removes backquote from comment. And, I forget to ask you about error message. What error did you meet ?

dtrce commented 8 years ago
screenshot 2015-11-22 19 40 21
arton commented 8 years ago

It seems fine. So it should be the problem of your rails environment setting. I think you try tiny code on you rails console. For ex) $VERBOSE=true $DEBUG=true require 'rbj' Rjb::load( your setting is here )

dtrce commented 8 years ago
screenshot 2015-11-22 20 01 11
arton commented 8 years ago

Hi I can read "can not load rubinius/ffi". Do you really want to use rubinius to run Rails? If so, please consult libffi people to install correctly in rubinius.

dtrce commented 8 years ago

Not sure where it's picking up rubinius from. I'm using rbenv

arton commented 8 years ago

I think it's better to re-check your environment. It seems badly conflicting. In such environment, naturally, Rjb can't run as normal

By the way, you continue to show ENV['JAVA_HOME'] I think it has wrong directory in it..