fn-fx icon indicating copy to clipboard operation
fn-fx copied to clipboard

example application exit automatically

Open chptx opened this issue 8 years ago • 9 comments

I run examples/other_examples/todo.clj with lein run on mac os sierra, when the window lose focus, the program will exit automatically with no error output.

chptx avatar Aug 18 '17 14:08 chptx

I would like to officially "bump" this, as this is happening with my application as well.

Tombert avatar Oct 11 '17 14:10 Tombert

I found that the same problem occurs when using lein run on mac os sierra with the form example in getting_started, but not with the hello world example or the 3D shapes example.

alanforr avatar Nov 12 '17 01:11 alanforr

Same here. If you keep mouse clicking of doing events then app stays open. If you stop moving or generating events then app exits. I am using the Hello World app...

staypufd avatar Feb 02 '18 00:02 staypufd

Same here (but for hello world as well). Regular java program using javafx-works (tm)

kitofr avatar Jul 10 '18 13:07 kitofr

I'm also able to randomly reproduce this on Java 11 using lein with-profile +openjfx11 run -m other-examples.todo/-main, but not reliably - sometimes the app quits if I stop providing input, sometimes I can leave it there, idle, as long as I like. Damnable heisenbugs!!

pmonks avatar Oct 20 '18 06:10 pmonks

Is it something to do with execution just falling off the end of -main? I was able to delay the problem here—the program stays running until the :quit event is delivered, then it quits after lack of activity (as before).

(I left out the bit which actually sends the :quit event in that commit, but it wasn't special in any way.)

Sorry I'm quite new to multithreaded programming and can't work out the root cause.

jdf-id-au avatar Nov 17 '18 06:11 jdf-id-au

If the application crashes with no error message I would guess it's a platform issue in JavaFX. I do not encounter problems on Linux. However JavaFX 11 does not work well with GTK3, I don't know if it's a bug or GTK3 is simply not supported, but I have to force GTK2 to make it work (done with -Djdk.gtk.version=2).

roti avatar May 17 '19 18:05 roti

Am stumbling on the same problem with macOS.

soynomm avatar May 26 '19 15:05 soynomm

I wasn't able to pinpoint why this is happening but the macro start-javafx is choosing to start the application using the pre Java 9 method even when the running with Java 11.

I've tried running my application by setting javafx.runtime.version to 11, but then the application hangs at AOT.

This is what my uberjar profile would look like:

{:uberjar {:aot :all
           :jvm-opts ["-Djavafx.runtime.version=11"]}

Furthermore, dropping to Java 1.8 Oracle JDK gives me the following error when trying to create an Uberjar (note, I've removed the javafx.runtime.version property this time):

Syntax error compiling . at (fn_fx/init.clj:16:8).
Syntax error (IllegalArgumentException) compiling . at (fn_fx/init.clj:16:8).
No matching method startup found taking 1 args for class javafx.application.Platform

jvtrigueros avatar Jun 10 '19 14:06 jvtrigueros