My problem was this: I used Intellij IDEA (tried different versions) + Gradle. When I compiled the project and builded artifacf jar, as indicated in the above responses, I received an error - "no main manifest attrubute ..."
This solution worked for me (special thanks to Thilina Ashen Gamage (see above) for tip):
Excerpt - if you use external libraries and build a project through Project Settings - Artifacts - Add (+) - Jar - From modules with dependencies, then probably because of a program bug the META-INF folder with MANIFEST_MF file not including to jar. To avoid it create EMPTY jar file.
Project Settings - Artifacts - Add (+) - Jar - EMPTY JAR. META-INF folder will added to resources folder. Then select your main class. You will see following jar structure: Note the presence of a folder META-INF Then you can build your project and build artifacts. This solution worked for javaFX applications too.