Issue
Following up on one of my questions in another post.
I added the maven-assembly-plugin
to my POM
, and now the jar works, but only if I double-click on the jar in the file system. If I try to run the jar from the command line, I still receive this error:
Exception in thread "main" java.lang.NoClassDefFoundError:
This concerns me, because it seems like this jar is not platform-independent. How can I fix this?
Solution
syntax to launch application from jar on cmd line
java -jar jarname
Given that you have Manifest.txt file with jar having Main-Class:*package.class_name_containing_main_method*
Answered By - ejb_guy