Compile jruby “Hello world” problem

前端 未结 1 1385
别跟我提以往
别跟我提以往 2020-12-28 23:51

I have been programming for a while with Ruby and I really enjoy it. Lately I started having the need of compiling some ruby code. For several reasons using Ruby2exe is not

相关标签:
1条回答
  • 2020-12-29 00:38

    Assuming you are on windows, I think your -cp arg is wrong: it should be semi-colon delimited:

    java -cp .;c:\jruby\lib\jruby.jar script

    But also, I had better luck by setting the CLASSPATH env separately, e.g.:

    
    C:\ruby>set CLASSPATH=c:\Program Files\jruby-1.4.0\lib\jruby.jar;
    
    C:\ruby>java hello_world
    Hello, world!
    

    But perhaps that's because my classpath needs a space in it.

    What version of JRuby are you using? As you can see, I'm on 1.4.

    0 讨论(0)
提交回复
热议问题