• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Are There Any Relevant JavaFX Deployment Tutorials For 2021?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm am so close to just throwing in the towel and switching to another language for creating cross-platform GUI desktop applications.

I just recently came from VB.NET (don't laugh, it worked!) and made the switch to Java because it was giving off the impression that building cross-platform GUI applications wouldn't require such a major learning curve or was to be a much easier process than many have made it seem.

I was so close to settling on with JavaFX after about 1 month of becoming content with and excited about the Java language, I finally tried to package up a very simple 1-button 'Hello, world!' application a few days ago, only to realize that it wasn't an 'easy process' after al.....In fact, it has been nothing but PROBLEMS!

I've been going on for days trying to find a simple solution, only to find out that most of these tutorials that I've been following were outdated and even deprecated.

Then I found in many online forums, folks are claiming that "JavaFX is DEAD"???

Anyhow, I apologize about this long, drawn-out, and even downright monotonous story that I've conjured for you. I'm just trying to see if anyone has a simple step-by-step solution that I can do in either Eclipse or IntelliJ Idea.....HELL, even the command line would be fine with me! I'm very eager to learn this.

If I can't find a solution soon, I'll have to switch to Electron or possibly Python with PyQT5. Please let me know before I just hang up the ol gloves. Thanks in advance if you can offer any support!

UPDATED:
I apologize, but I've already tried the default exporting in both Eclipse & IntelliJ Idea, and touched a little on Maven, but Maven requires a learning curve. If anyone has a good little example I can follow, I would appreciate it.

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aaron --

  I struggled with FX pretty much from the time it came out many years ago.

  The absolute BEST resource for doing FX is:  Sharan, K.  Learn JavaFX 8.   For the last 6 years it is has been my FX bible.  Very clear, very useful, very authoritative.
 
  If you are new to Java, Liang, Y. D.  Introduction to Java: Programming and Data Structures (Comprehensive version) is my go to resource.

  Good luck!

  -- Chris  ([email protected])

  P.S.  I am working on a relatively massive project with lots of FX.  You are welcome to the source code (it is freeware) -- lots of FX that you might use as examples of code.   I use NetBeans and Maven, but it shouldn't matter.  The code has lots of mathy stuff that can be easily ignored.
 
Bartender
Posts: 15737
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aaron, in your other topic I posted an example of how to get JavaFX running using Maven. Once you have set it up, you don't have to look at Maven again unless you want to change something about the build process, and you can learn Maven when it suits you.

I wouldn't say JavaFX is dead. It WAS dead for a short while because there wasn't a party that was willing to maintain JavaFX. Since then various updates came out. Most online forums are just parroting what they heard once.

It's true that there's probably not a good single source for a modern JavaFX tutorial. I suggest you scrape by with what you can find, and post your code here for review. That way you will get up-to-date advice.

I think the frustration mostly comes from GUI coding being difficult in the first place, especially if you've only experienced the underlying infrastructure for only a month. You rushed into JavaFX without really getting familiar with the language and build tools. I'm not saying you shouldn't have, sometimes that's how we do new stuff. But it's important to realize it's not the ideal path.

We're here if you need help. And if you just need to vent, that's okay too.
 
Sheriff
Posts: 28346
97
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it makes you feel any better: getting your Java application to run on somebody else's computer has always been a huge pain. It's easy enough to write the Java app to run on your computer. But to run it on somebody else's computer, you have to ensure that they have a JRE installed there. And you have to ensure it's the right level; maybe you used Java 11 and they only have Java 8. And once you've got your application and the right version of Java, you have to make sure that the "somebody else" can find your application.

Yes, Java is Write Once Run Anywhere. But it's certainly not Write Once Install Anywhere. For Windows, for example, you either need to produce a Windows installer or else you need to write a page of instructions on how to get the Java environment configured correctly and how to create a suitable shortcut on the desktop, hoping the recipient can understand the instructions and execute them correctly. And no doubt other target operating systems have similar issues, although I'm only familiar with the Windows variety.

Oracle's solution to that was JNLP: you'd put your application on your web site and set up a configuration file (also on the web site) which allowed the consumer to download the application and, if necessary, install a suitable JRE at the same time. I used this a lot at work and it worked very well, at least with Windows. But that all died when applets were (rightfully) thrown overboard and now you're back to square one.

Bear in mind that I haven't had to wade into that swamp for several years now, so what I just wrote should be read in the past tense. In particular Maven is something I haven't worked with. So hopefully you can get it to produce a full package of JRE plus application which can be simply copied to another computer -- check it out.
 
Aaron Esteban
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Chris, and thank you so much for the resources!

So, just to clarify, I don't believe that I need learning resources on how java works or how to use JavaFX, I am already familiar with how to create GUIs and get them running in the IDE.
I've even gotten as far as multithreading with some jSoup and RegEx.

The only real aspect that I'm trying to focus on now, is how to compile/package my jar files up into a 'FAT JAR' file using either Eclipse or IntelliJ with Maven. I even understand a bit of how a POM file is to be structured and used.
The problem that I'm having is the file/directory structure of how the files (classes & .fxml) are to be placed and where exactly, inside of the Eclipse "Package Explorer" area after a Maven project has already been created.

I just need someone to show me a simple example of how the project folders & files should be placed prior to exporting to a 'fat jar' file.

Does either of your recommended books contain such content.....or.....do you happen to have a quick demonstration you can post here? I'd like to see an image of your file/directory structure inside of Eclipse (preferably), even though I know that you're using Netbeans. Please let me know if you can get around to do a quick setup. I'd greatly appreciate it.

Oh, and here is what my file/path/directory structure looks like at this point after starting a new Maven project in Eclipse:




Am I supposed to start out with a NEW "Maven project" and build off of that, or am I supposed to start with a NEW "JavaFX project" and later convert it to a Maven project? Which way is best?

Then how do I set up my files?

What is step #1, step #2, step #3, etc., etc.?





Chris R Olsen wrote:Aaron --

  I struggled with FX pretty much from the time it came out many years ago.

  The absolute BEST resource for doing FX is:  Sharan, K.  Learn JavaFX 8.   For the last 6 years it is has been my FX bible.  Very clear, very useful, very authoritative.
 
  If you are new to Java, Liang, Y. D.  Introduction to Java: Programming and Data Structures (Comprehensive version) is my go to resource.

  Good luck!

  -- Chris  ([email protected])

  P.S.  I am working on a relatively massive project with lots of FX.  You are welcome to the source code (it is freeware) -- lots of FX that you might use as examples of code.   I use NetBeans and Maven, but it shouldn't matter.  The code has lots of mathy stuff that can be easily ignored.

 
Aaron Esteban
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks again Stephan! Yeah, I looked at your POM and got the overall idea of how the project will include the dependencies, but I still need someone to guide me on the file and folder structure inside of the "Package Directory" inside of Eclipse after starting a new Maven project. Can you send me a snippet image or code here? I need to see where the files should be inside of what folder. Please take a quick look at the message that I've sent to Chris above. I've posted a quick snip of what my directory looks like inside of my "project1" project.


Stephan van Hulst wrote:Aaron, in your other topic I posted an example of how to get JavaFX running using Maven. Once you have set it up, you don't have to look at Maven again unless you want to change something about the build process, and you can learn Maven when it suits you.

I wouldn't say JavaFX is dead. It WAS dead for a short while because there wasn't a party that was willing to maintain JavaFX. Since then various updates came out. Most online forums are just parroting what they heard once.

It's true that there's probably not a good single source for a modern JavaFX tutorial. I suggest you scrape by with what you can find, and post your code here for review. That way you will get up-to-date advice.

I think the frustration mostly comes from GUI coding being difficult in the first place, especially if you've only experienced the underlying infrastructure for only a month. You rushed into JavaFX without really getting familiar with the language and build tools. I'm not saying you shouldn't have, sometimes that's how we do new stuff. But it's important to realize it's not the ideal path.

We're here if you need help. And if you just need to vent, that's okay too.

 
Aaron Esteban
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I finally got it all figured out!!!

I managed to create an "UBER FAT .JAR" file and then package it all up using the Jpackage on the command line.

So here's a brief summary of how I did it:

Step 1. I started a JavaFX project inside of Eclipse and built out my FXML GUI in Scene Builder.

Step 2. I converted it into a "Maven Project" to compile a nice "Uber FAT jar".

Step 3. I went on over to the ol command line, then ran the "Jpackage" commands to convert the "Uber FAT jar" into a Windows executable file to make it easily distributable on Win OS.

These are the broad ideas of how I managed to make it all work out. If you guys need me to post some code here, let me know. I'm here to help as well. Thanks again for all of your ideas and support!

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, you got JavaFX to work for you. Then you don't need this advice:

The latest version of JavaFX is here: JavaFX (openjfx.io)

And, the guide to getting started with JavaFX is here: Getting Started with JavaFX (openjfx.io/openjfx-docs/)
 
Chris R Olsen
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aaron --

 Apologies for disappearing on you!   I've been immersed in writing and reading midterm exams and sneaking some restful programming time today.

 Glad to hear you got it!   I would be happy to share my folder structure, but I'm using Netbeans, not Eclipse.  I have Eclipse but my knowledge is not sufficient to reproduce anything like the folder structure you posted.

 Wishing you continued best of luck in your learning...

 -- Chris
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Aaron, JavaFX and Java do have steep learning curves but the benefit is that there is good support most of the time. There are a few resources that I've found to be helpful. The book, Learn JavaFX as mentioned above. Core Java Fundamentals and Core Java Advanced Features. And Introduction to Java by Liang. All Java bibles/text books have a few errors, but I've never run into a problem I couldn't eventually solve. In the beginning it was difficult. Now several years later, there is an occasional update that causes a disruption such as the shift between java 8 and java 11.

Java is a performant language. It is not the fastest (although this is arguable), but it is compiled, flexible, and abstracts memory issues (which you should be aware of anyway). It is probably the most economical considering the cost of engineering, added to the cost of operating in the cloud.

Maven is a great tool for integration and building your projects. It automates testing and deployment making life "Generally" easier. At least until there is an update that takes a few days to get back on track with. There are a lot of articles posted that are decent tutorials. But you are better off sticking to the text books when possible. The texts are driven from principles and are reviewed for errors. However, the texts are usually behind Java technology. Roughly three to four years behind.

I have not found a good text that covers Maven nor Gradle. Gradle is the Android default build tool. I have found that Maven is easier to use and there are enough information available to make it work.

Also, be aware about the Java and JavaFX update cycles. If you plan to deploy your applications in the future. You will need to keep up with the latest supported updates. The 6 month updates may solve some problems, but have caused some instability with our development.

A key to be aware of that I have not seen in texts. The differences between an application that is deployed, and an application running in an IDE or IDEA environment. How a java application finds its files will cause some issues when it is deployed. This is an issues that Java developers have been aware of and is not really an issue any more. And Maven, helps to solve with its file structure. Stick to good information resources to find your answers. This will prevent frustration with incorrect answers.


The Maven Tutorial I found most recently is still missing a lot of context. You will need to be familiar with Maven but this is the best start I've found: https://www.vogella.com/tutorials/ApacheMaven/article.html  


-- Runnermann

 
So I left, I came home, and I ate some pie. And then I read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic