Main class not found even when its existing i'm working in my tablet a project that i want to run in my raspberry pi. The IDE AIDE,  that i'm using can't export my project as an executable jar file. so i decided to try that by using the command line
I used:
jar cvf ServerActivities.jar *

too create the jar file whichbworked but when i want to start it by using
Java -jar ServerActivities.jar

it says that my Main class couldnt be found or loaded, but it exists and contains an main method

You need to create a manifest and point to your Main class from there.
See: https://docs.oracle.com/javase/tutorial/deployment/jar/appman.html
or: How to setup Main class in manifest file in jar produced by NetBeans project