Ask coding questions

← Back to all posts
Can JavaFX programs work in repl.it?
ghutchis (0)

I tried to test a simple JavaFX program using Java with Swing and regular Java, but both attempts could not import the javafx package.

Has anyone been able to get JavaFX to work in repl.it?

Thanks,

Answered by EpicGamer007 (1601) [earned 5 cycles]
View Answer
Comments
hotnewtop
EpicGamer007 (1601)

Unfortunately, repl does not support javafx. It might in though future though.

:)

EpicGamer007 (1601)

@ghutchis, If you want to make GUI applications, I suggest just doing it on your computer.

ghutchis (0)

@AbhayBhat Thank you - I thought that if Java Swing and Pygame was made functional in an online environment maybe JavaFX would be able to work, but I will move to an installed IDE for Java GUIs.

EpicGamer007 (1601)

@ghutchis, ok thats good

Please mark my answer as correct if it helped you :)
mlavallee (0)

As of 2020-12-28 it is feasible but it is not pretty. You can do it if you upload the whole OpenJFX library in your Repl.it. This can be difficult because the library is about 100Mb. And then you can override how the "Run" button works by default using a ".replit" file and a Bash script.

I made an example here: https://repl.it/@mlavallee/JavaFxTest (sorry comments are in French in the code)