0

I have created a JavaFX app, but it seems that servers do not support UI applications. What is the easiest way to develop Java apps for servers? (In other words, what solution does IntelliJ IDEA have? I don't want to rewrite a lot of code)

2 Answers2

1

JavaFX is a technology for creating desktop (client) application on Java. These application are run on a local computer, that computer the user is currently interacting with. There is Java WebStart technology. It lets us place the application .jar (java executable) on the server and call it via a link from a web page or direct URL. In this case the application will still be running on user's local computer. At the same time, application deployment can be easily managed, since the application executable is sitting on a single location on the server.

JavaFX works with WebStart, you will need to create a JNLP file. It is a descriptor of the application. Here is some info: Java WebStart I hope this helps.

Igor Kanshyn
  • 867
  • 6
  • 13
  • 1
    Just wanted to point out that WebStart is deprecated: https://stackoverflow.com/a/47168855/66207 – keuleJ Aug 20 '18 at 06:36
  • @keuleJ It's important to point that out. The java-version with the latest end-of-support-date which supports WebStart is SE-8. You can go with SE-8 until 01/2019 (commercial) / 12/2020 (personal).By the way: After 09/2018 SE-8 is the only supported version for WebStart. – Flocke Aug 20 '18 at 07:35
  • Thank you, I did not know that WebStart will not be supported. Is there an alternative? – Igor Kanshyn Aug 20 '18 at 16:07
  • I wanted to know if it is possible to create a console application for running on a server (.jar?) and create a JavaFX (or whatever UI) app to control the server app. –  Aug 20 '18 at 17:57
  • The natural fit for a server application would be any kind of web interface. – keuleJ Aug 21 '18 at 14:26
0

Java Web App? if I understand you, get my small advice.

You will have to rewrite all controllers, and change UI fxml forms to web pages (html + thymeleaf, jps, jsf and so on).

If you have bad project architecture, for example: you connect with database and retrieve data into controller classes, methods, it's so bad, and you will rewrite a lot of code.

But if it don't You should just create web controllers, inject needed services, facades and call needed methods there.

Good luck)

ImZ
  • 46
  • 1
  • 9
  • I am at the beginning, so it won't take a lot of time. I wanted to know if it is possible to create a console application for running on a server (.jar?) and create a JavaFX (or whatever UI) app to control the server app. –  Aug 20 '18 at 17:55
  • Running console application on the server and displaying results on the web page is doable. But if you already have JavaFX application, you cannot run it simple present the results on the server. It looks like best option would be to rewrite data input and output screens into JSP or something like that. – Igor Kanshyn Aug 21 '18 at 17:17