jrubydesktop-applicationwarbler

Created jar from JRuby file using warbler. Application exit/goes in a blink when run


I have created a JRuby desktop application. Now I need to create installation file for different platforms(Windows, Linux, Mac).

I have created .jar file using warbler. But when I try to run the .jar, application starts and exit in a blink. It seems application is not crashing as the log says got via java -jar MyApp.jar > log.txt.

Why the application exit, doesn't just stay. Can somebody help me on what I am missing. How I can track the issue?


Solution

  • This answer will help for the issue: JRuby script with Rubeus and Swing exiting once packaged into jar using warble

    The workaround described is to put below code in your App's main file

    event_thread = nil
    SwingUtilities.invokeAndWait { event_thread = java.lang.Thread.currentThread }
    event_thread.join