I'm trying to run my java class with dependencies in the command line. And I'm used IntelliJ Idea 13 to build artifact from my project. I have a main class say "Main.java" and after the build I got a jar file like mytest.jar. The Main.java's full qualified name is like "test.Main"
But when I'm trying to run it using "java mytest.jar", it complained that cannot find main class mytest.jar.
I checked the files in the jar and it seems like I got all the dependencies I need, and the main class in the MANIFEST.MF seems also ok. And actually if I unzip the jar into "mytest" folder, and try run "java test.Main" in it I works good.
My jar file is like this:
mytest
--test
----Main.class
--META-INF
----MANIFEST.NF
--org... //dependencies
My MANIFEST.MF is like this:
Manifest-Version: 1.0
Main-Class: test.Main
So what's your advice?
UPDATE: the Main-Class MANIFEST.MF is test.Main, I'm using a simple example in this question and forgot to change the content, sorry.