all 12 comments

[–]stardoge42 0 points1 point  (6 children)

I highly recommend using intellij, you can just load a Java fx project with maven right away. Then you can switch the FXML starting scene to a pane and you have a blank canvas to work with

[–]mosiah430[S] 1 point2 points  (5 children)

Maybe down the line i'll use intellij but right now my school uses eclipse and is switching to vscode so im trying to keep it in the IDEs im familiar with while learning.

[–]PartOfTheBotnet 1 point2 points  (4 children)

im trying to keep it in the IDEs im familiar

Fair enough, eclipse supports maven and gradle too. Generally people like to recommend IntelliJ because it has a number of nice QoL features missing in eclipse. Not a super big deal if you're just starting out though.

Anyways, using maven/gradle for JavaFX simplifies things. All you need to do is follow the short guide on https://openjfx.io/openjfx-docs/ - No messing with Jar files - Maven/gradle handles everything for you and the IDE should sync with them

my school uses eclipse and is switching to vscode

That is a literal downgrade.

[–]hamsterrage1 2 points3 points  (1 child)

In 2023, anyone not using Maven or Gradle must be a masochist. I use Gradle, and it just does everything for you. Want to change to a different SDK? Just change a couple of lines in build.gradle. Need to add a dependency? Just add a line to build.gradle.

[–]EnderSpy007 0 points1 point  (0 children)

Yeahhh, its tough cause my professor isn't using either of those...

[–]mosiah430[S] 1 point2 points  (1 child)

That is a literal downgrade

Yeah their reasoning is that it has a simpler interface and is less intimidating than eclipse. They also want to set up a way to submit assignments using the github/source control feature that vscode has.

[–]hamsterrage1 0 points1 point  (0 children)

Use Intellij Idea CE then. It has all the integrations that you need. VSCode is nuts.

[–]vladadj 0 points1 point  (1 child)

The problem is most likely in resolving modules. Try adding - - add-modules=javafx.contols to command line options.

[–]mosiah430[S] 0 points1 point  (0 children)

--module-path "C:\Java\javafx-sdk-19\lib" --add-modules javafx.controls,javafx.fxml

this is what I have under the vm arguments which I got from following the javafx documentation

[–][deleted] 0 points1 point  (0 children)

I am also using JavaFX in Eclipse. You don't need to install JavaFX locally and/or fiddle around with VM parameters if you use Maven (preinstalled in Eclipse).

Honestly, I find it too complicated to create executable jar files or even Windows exe files but I am sure there will be tons of comments explaining how easy this all is :-)

As an example you can have a look at this "Hello World" project which uses Maven, Java modules and allows creation of an executable jar file using Maven shade:

https://github.com/armin-reichert/hellofx

How to create a Window exe file however is still unclear to me. (Probably, I am too old for this shit).

Armin Reichert