-J prefixed options should be passed to javac … e.g. jrubyc -J-target
1.5
hello_world.rb
JRuby needs 1.6 at minimum you won’t be able to compile for 1.4 … well
you might be but it won’t run.
K.
Thanks for replay, but somehow this solution not works
On my local machine I have “1.7” Java, on client machine is “1.6” Java.
Before deploy locally I am compiling all ruby files.
I run multiple tests by compiling Ruby file using jrubyc command. One
time I passed -J-target 1.6 option, other time I used -J-source 1.6
option
Both time when I deployed code on machine where is “1.6” Java I got
following error message by application startup
java.lang.UnsupportedClassVersionError: app/models/foo : Unsupported
major.minor version 51.0
I checked JRuby source code
Yes, jrubyc command is accepting -J options for which will be passed to
javac, but seams that these options are used only if is passed javac
option which will generate from .rb files .java files
Only solution what worked for me was install second Java (1.6) on local
machine, and by compiling use 1.6 Java
Artis
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.