Search code examples
maven-2javac

Error : Could not find or load main class


I have compiled the maven project using "mvn install" command. test.jar file is created in the path of /project/target/test.jar.

I am just trying run the the command "sudo java -jar test.jar". Getting below error

Error: Could not find or load main class com.xxx.xx.controller.MainApp.

Could you please help to resolve this error.

I am new this technology(maven).

Note: This code I am compiling in ubuntu 20.04 64 bit machine.


Solution

  • Issue is resolved after reinstalling JDK 8.