0

I am new to IntelliJ and JavaFX. Many of the tutorials online (many over a year old) require you to do various things like add JavaFX to the libraries and Add VM options. They all have multiple steps to set up. Problem is, my IntelliJ looks different. When I create a project with JavaFX there is no main.java file but one called "HelloApplication.java" instead. Maybe they are using an older version, but I can not seem to find an updated tutorial.

enter image description here

According to this website: https://www.jetbrains.com/help/idea/javafx.html#troubleshoot no extra setup appears to be needed besides what is automatically generated. I read elsewhere you need to set VM options, but all tutorials use the main.java file to do this. I try to follow tutorials but I always run into problems.

In summary, I'm not sure with the newest version of IntelliJ if I need to do any setup or if it's automatically done since my version looks different.

jari85
  • 71
  • 5
  • 2
    Just run this class or create a configuration where you can edit VM options. Refer to https://www.jetbrains.com/help/idea/run-debug-configuration.html. Class name doesn't matter here. – CrazyCoder Mar 14 '23 at 17:22
  • 2
    Did you try just running the `HelloApplication` class? What happened? – James_D Mar 14 '23 at 17:56
  • HelloApplication runs just fine without me needing to do anything. But I am unsure if later on I will encounter problems since everything else said setup was required. – jari85 Mar 14 '23 at 18:26
  • Do I need to Add VM options? Is it necessary, or can you make a Java GUI without it? – jari85 Mar 14 '23 at 18:26
  • 2
    Well, clearly (since you just said you've done it), you can make a Java GUI in IntelliJ without manually adding VM options. If there are additional options that are needed to run your application that aren't needed just for a plain JavaFX application, then you'd need to run those, but any options that are specific to JavaFX have already been set for you (else the application wouldn't run). – James_D Mar 14 '23 at 18:37
  • 1
    And if you want relatively up-to-date instructions for creating JavaFX applications, check out [Getting Started with JavaFX 11+](https://openjfx.io/openjfx-docs/#introduction). Note there are JDK distributions out there that still include JavaFX, even though the distribution from Oracle does not. The vendors include _BellSoft Liberica_ and _Azul Zulu_ (and possibly others); if you use these, make sure you download the correct package if you want JavaFX included. – Slaw Mar 14 '23 at 18:46
  • *"Many of the tutorials online (many over a year old) require you to do various things like add JavaFX to the libraries and Add VM options."* -> when getting started, ignore online tutorials you find, follow only current official [Idea New JavaFX project](https://www.jetbrains.com/help/idea/javafx.html) documentation or the getting started documentation for openjfx.io previously linked. – jewelsea Mar 14 '23 at 23:42
  • 1
    For some additional info on using and customizing the project created by the Idea new JavaFX project wizard, see [Basil's answer on using the tool](https://stackoverflow.com/questions/74764217/error-javafx-runtime-components-are-missing-with-intellij-idea-maven-and-jdk/74764297#74764297). – jewelsea Mar 14 '23 at 23:44

0 Answers0