Running javafx sample on JDK 11 with OpenJFX 11 JMODS on Module Path

后端 未结 2 1258
我在风中等你
我在风中等你 2020-12-05 15:19

I have downloaded the JavaFX Jmod files from OpenJFX project and placed them in the directory G:\\openjfx\\javafx-jmods-11. I am using OpenJDK 11 which has no J

2条回答
  •  生来不讨喜
    2020-12-05 16:08

    If it is not automatically added it, try using this setup in the pom.xml. Be sure to change the "!!YOUR MAIN CLASSNAME HERE!!" towards the bottom of the code to the name of your class with the main method! If my class is Example.java I will want to put in there just Example.

     
        
            org.openjfx
            javafx-controls
            11.0.2
        
        
            org.openjfx
            javafx-fxml
            11.0.2
        
    
    
        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                3.8.0
                
                    11
                
            
            
                org.codehaus.mojo
                exec-maven-plugin
                1.6.0
                
                    
                        
                            java
                        
                    
                
                
                    !!YOUR MAIN CLASSNAME HERE!!
                
            
        
    
    

    JavaFX is not automatically added as a dependency with Java 11. That's why we need added manually.

提交回复
热议问题