在manifest.mf 里面指定
main-class:类名

解决方案 »

  1.   

    奇怪我用 jar cf test.jar test就可以。为什么
      

  2.   

    又有一个问题运行
    trogon% java -jar test.jar
    Failed to load Main-Class manifest attribute from
    ????
      

  3.   

    当然啦,没有设置激活的main成员
      

  4.   

    在manifest中Main-Class: test.test
    :和test必须有一个空格?好像有了之后jar就没有问题。
    现在的问题是java -jar test.jartrogon% java -jar test.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: test/test (wrong name: test)
      

  5.   

    solution:
    1:in app/test,javac test.class
    2:vi manifest.mf,add 'Main-Class: Test' with enter at end
    3:jar cmf manifest.mf test.jar test.class
    4:java -jar test.jar
    5: copy test.jar to your dist.