Unable to run the javafx project using command line

十年热恋 提交于 2019-12-02 06:42:37

Your class is declared to be in the package application. So, to compile it so that you get the correct folder structure you should compile with the -d option:

javac -cp "C:\Program Files (x86)\Oracle\JavaFX 2.2 Runtime\lib\jfxrt.jar" -d . Main.java

That should create a directory called application, and Main.class will be in there.

Then execute (from the same folder, not from the application folder) with

java -cp "C:\Program Files (x86)\Oracle\JavaFX 2.2 Runtime\lib\jfxrt.jar";. application.Main
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!