IntelliJ IDEA 2023.1.3 (Community Edition) Macbook
1. New Project > JavaFX
- Name : demo
- Location : ~/IdeaProjects/demo
- Language : Java
- Build System : Maven
- Group : com.example
- Artifact : demo
- JDK : 18.0.1 (default)
2. Test build & Run
- success, normal
3. File > Project Structure... > Artifacts > + > JAR > From modules with dependencies
- Module : demo
- HelloApplication (com.example.demo)
- JAR files from libraries > Extract to the target JAR
- Directory for META-INF/MANIFEST.MF: /Users/quenyan/IdeaProjects/demo/demo/src/main/resources
- OK, then OK again to close the Project Structure
4. Build > Build Artifacts...
- demo:jar > Build
- the file output at /Users/quenyan/IdeaProjects/demo/demo/out/artifacts/demo_jar/demo.jar
5. First try directly
- Right click the demo.jar in IDEA > Open in > Finder
- Double click the demo.jar in finder
- got this
Java Application launch failed.
Check Console for possible error
messages related to "/Users/quenyan/
IdeaProjects/demo/demo/out/artifacts/
demo_jar/demo.jar".
6. Second try on terminal
- java -jar /Users/quenyan/IdeaProjects/demo/demo/out/artifacts/demo_jar/demo.jar
- get this
Error: JavaFX runtime components are missing, and are required to run this application
What did i missed?