Openjfx 11

已回答

Is there any information/tutorial on how to set up and use openjdk-11 and openjfx-11?  (windows)

I can compile my program but I cannot run it.  I get the following message:

Error: JavaFX runtime components are missing, and are required to run this application

What is the setup for the end user to run programs using javafx 11?

 

0
Avatar
Permanently deleted user

I followed that advice on Stackoverflow but did not understand point 4 which read :

4. Before you run the default project, you just need to add these to the VM options:

--module-path /Users/<user>/Downloads/javafx-sdk-11/lib --add-modules=javafx.controls,javafx.fxml

--

I'm new to Java and was forced from Netbeans to IntelliJ Ult.(long story).

I looked up VM..and found under Help : Edit Custom VM options ..is that it?

It created a file that looked like it had nothing to do with the line above? (As below.)

Can someone spell it out in simple terms for an idiot like me. thanks! 

# custom IntelliJ IDEA VM options

-Xms128m
-Xmx750m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow

 

0
Avatar
Permanently deleted user

I found this which helps although I still have issues..

 
File -> Project Structure -> Modules -> Dependency tab add (+) the lib directory where you have unpacked JavaFX (for me, C:\Program Files\Java\javafx-sdk-11\lib).

Scope is Compile (which is the default.) You can then edit this to call it JavaFX by double-clicking on the line.

then in Run->Edit Configurations -> VM Options, put: --module-path="C:\Program Files\Java\javafx-sdk-11\lib" --add-modules=javafx.controls

(oh and don't forget to set the SDK)

0
Avatar
Permanently deleted user

<quote>then in Run->Edit Configurations -> VM Options, put: --module-path="C:\Program Files\Java\javafx-sdk-11\lib" --add-modules=javafx.controls</quote>

when I create a new one project I have to do the same actions. Is it possible to set up it once and don't repeat it every time?

0

Hello Victor,

It's possible to add it in "Run->Edit Configurations->Templates".

0
Avatar
Permanently deleted user

Sorry, but I don't understand which one should I edit for FX. Please, explain

0

Victor,

JavaFX projects use "Application" run configuration. You could change default template "Run->Edit Configurations->Templates-> Application" adding your option. Please note that it will affect all generated run configuration of "Application" type.

0
Avatar
Permanently deleted user

Thanks a lot

0

It would be great if this entire process could be simplified with some sort of built wizzard to set it up properly.. feel like half the problem with java development is the crazy setup process just to get it all compiling and running.. for a some one not at all familiar with it, it's a real head banging experience trying to figure out why things don't work and what it is that needs doing to get things working.. I mean does it really need to be like this? As an IDE could surely do more in this area I think.

0

I added this to the VM and It worked

--module-path "C:\Program Files\JAVAFX\javafx-sdk-16\lib" --add-modules javafx.controls,javafx.fxml

0

请先登录再写评论。