我试图将一个简单的JRuby脚本打包到一个jar文件中.该脚本使用Rubeus :: Swing,并在使用JRuby解释器执行时正确运行.
require 'rubygems'
require 'rubeus'
class Example01
extend Rubeus::Swing
def show
JFrame.new("Rubeus Swing Example 01") do |frame|
frame.visible = true
end
end
end
Example01.new.show
Run Code Online (Sandbox Code Playgroud)
一旦我将脚本打包到JAR中warble,当我执行时:
java -jar jtest.jar
Run Code Online (Sandbox Code Playgroud)
... JFrame窗口显示并立即关闭.
没有任何错误的迹象.
有谁知道为什么会这样?