How to create a .jar file using the terminal

I’m trying to create a .jar file using the mac terminal but am having bit of trouble. I followed the steps here but was unsuccessful. I got this error message: Failed to load Main-Class manifest …