'jar file, created by netbeans in dist not opening

I have a project on netbeans and after buliding the project the jar file is generated along with lib folder but jar is not opening. When i tried to run the jar from command line, it says

Error: Could not find or load main class jewelleryinventory.JewelleryInventory
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

Any help would be good. It used to open previously but now not opening. Also i can run it from netbeans.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source