Skip to content

JRubyFX application not working when running from jar (works in 1.7, doesn't work in 9k) #4000

@oreoshake

Description

@oreoshake

Environment

Provide at least:

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)
    • jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f Java HotSpot(TM) 64-Bit Server VM 25.60-b23 on 1.8.0_60-b27 +jit [darwin-x86_64]
  • Operating system and platform (e.g. uname -a)
    • Darwin Neils-MacBook-Pro-4.local 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64

Other relevant info you may wish to add:

Expected Behavior

The test application at https://github.com/oreoshake/jrubyfx-9k-jar-problems should build and run just fine. $ bundle && rake && java -jar BrakemanPro.jar should launch the app.

Actual Behavior

builds and runs just fine under jruby 1.7.21, but fails under 9k:

$ bundle && rake && java -jar BrakemanPro.jar
Errno::ENOENT: No such file or directory - classpath:/Users/neilmatatall/workspace/jrubyfail/brakeman-pro/jar-bootstrap.rb
          realpath at org/jruby/RubyFile.java:810
  require_relative at uri:classloader:/jruby/kernel/kernel.rb:11
             <top> at classpath:jar-bootstrap.rb:1

But if I unzip the jar and run the file directly, everything is happy:

$ mkdir tmp && cp BrakemanPro.jar tmp/ && cd tmp && unzip BrakemanPro.jar 
... accept the file overwrites ... 
$ ruby jar-bootstrap.rb

There's also a flag for compiling code and using that in the jar, but I ran into errors that I can no longer reproduce so it's disabled by default.

Since we're not using much of JRubyFX to build the jar, I assumed the problem lies with some difference between jruby 1.7 and 9k instead of a jrubyfx problem but I could of course be wrong.

EDIT:

I lied, this could also be a jrubyfx thing since I do call the jarify command:

system 'bundle exec jrubyfx-jarify . --main bin/brakeman_pro_jar.rb BrakemanPro.jar --include-jars --verbose --name "BrakemanPro"'

I will file an issue there too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions