I have a Java Code where I am able to run it on Intellij using custom configuration. The configuration has following attributes :-

* module : java 8 (Oracle OpenJDK 1.8.0\_321)
* classpath : -cp XYZ.main()
* main : com.ABC.XYZ.ManageTraffic
* CLI arguements : server XYZ.yml

But when I try to run the jar that was build using gradle from terminal , it gives me Error , could not find or load main class com.ABC.XYZ.ManageTraffic

So far I have tried the following things looking at other solutions at Stackoverflow , still getting the same error

* java -jar ques.jar
* java -jar ques.jar com.ABC.XYZ.ManageTraffic
* java -cp /build/libs/ques.jar com.ABC.XYZ.ManageTraffic

Just to cross check , I unzipped the creataed jar and found that com.ABC.XYZ.ManageTraffic class file is available there , still getting error. What could be the issue?