Reputation: 7
How to call JAR CLASS with CMD
I am a newcomer to java.
This is my JAR file
https://drive.google.com/file/d/16bL0n4KS9IP75tDJhhbeNLeiS3boX3iP/view?usp=sharing
I want to use CMD to call the CLASS inside JAR.
I tried to call getHardware()
java -cp uhfrcom13_v1.9.jar com.handheld.uhfr.UHFRManager.getHardware
I got the error
The main method is not found, define the main method as: public static void main(String[] args) Otherwise the JavaFX application class must extend javafx. The application class must extend javafx.application.Application
Please master teach me how to call
Upvotes: 0
Views: 131
Reputation: 369
Make the following changes and it will work.
java -cp "uhfrcom13_v1.9.jar" com.handheld.uhfr.UHFRManager
Upvotes: 0
Reputation: 390
In UHFRManager
class you have to add public static void main(String[] args)
- in this method you can call your getHardware()
method. When running jar file, java is always looking for main
method in your class.
Upvotes: 0