JRuby

jruby can't load file produced with jrubyc

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1.5
  • Fix Version/s: JRuby 1.2
  • Component/s: Compiler
  • Labels:
    None
  • Environment:
    Mac OS X 10.5.6
  • Number of attachments :
    1

Description

It seems like files compiled with jrubyc on Mac OS X produce unusable output.
Here the steps to recreate. I also attached a compiled test file.

1. Create a file with content "print 'fun'"
2. run with standart ruby: output --> fun
3. compile the file with jrubyc
4. run with jruby -S file.class
output
$ jruby -S test.class
:1: test.class:1: Invalid char `\276' ('??') in expression (SyntaxError)

Activity

Hide
Logan Barnett added a comment -

The jruby command runs (J)Ruby scripts.
Once you compile something using jrubyc, everything is in Java byte code. You can run it with the java command.
java test.class
If you manage to jar up the class, you will have a double-clickable jar
You can also invoke jars like so from the command line:
java -jar test.jar

If you're looking at compiling your projects, be sure to take a look at Rawr so you don't have to write a bunch of compile/jar scripts yourself. Rawr can also make .jar, .exe, and .app files.

http://rawr.rubyforge.org/

Show
Logan Barnett added a comment - The jruby command runs (J)Ruby scripts. Once you compile something using jrubyc, everything is in Java byte code. You can run it with the java command. java test.class If you manage to jar up the class, you will have a double-clickable jar You can also invoke jars like so from the command line: java -jar test.jar If you're looking at compiling your projects, be sure to take a look at Rawr so you don't have to write a bunch of compile/jar scripts yourself. Rawr can also make .jar, .exe, and .app files. http://rawr.rubyforge.org/
Hide
m added a comment -

ok stupid me.

Please close the bug then.

Show
m added a comment - ok stupid me. Please close the bug then.
Hide
Charles Oliver Nutter added a comment -

I wonder if perhaps we could make the jruby command smart enough to load precompiled scripts too. Seem like a good idea?

Show
Charles Oliver Nutter added a comment - I wonder if perhaps we could make the jruby command smart enough to load precompiled scripts too. Seem like a good idea?
Hide
m added a comment -

Very good idea!

Show
m added a comment - Very good idea!
Hide
Charles Oliver Nutter added a comment -

Ok! I implemented it in r8393. Seems like such a no-brainer, I can't believe I didn't do it sooner.

Show
Charles Oliver Nutter added a comment - Ok! I implemented it in r8393. Seems like such a no-brainer, I can't believe I didn't do it sooner.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: