你的清单文件里设置Main-Class设置错了,有包名的要加上包名。
如:你的主类是org.hello.MainFrame,就设置为这个样子!

解决方案 »

  1.   

    回 tomcatjava(小鱼儿) :
    没有社错的,我下载别人的产品.jar都是这个问题,比如大名鼎鼎的robocode-setup.jar
      

  2.   

    http://www.javaresearch.org/forum/thread.jsp?column=16&thread=14358
    我帮你找了找答案,我觉的上面的贴子可以解决楼主的问题
      

  3.   

    谢谢小虫的推荐,不过我要运行的jar包是别人已经写好的应用软件,我不需要把它做太多的修改吧?
      

  4.   

    这个确实是挺烦人,我用过两个系统,2000,Xp,两个系统一开始的时候都可以运行下载的一些jar程序,后来装了winrar误关联了jar,就手动改,改之前用javaw a.jar测试还可以用,改了之后也可以,可是过了一会儿不知道怎么回事就不行了,不管是双击,还是用命令行运行,都保错 could not find the main class
      

  5.   

    解决方案:主要是运行参数-jar,javaw -jar a.jar,可能有的机器不用。但是如果出错了
    ,不妨试试。
    Problem Resolution - Executable jar file fails to run
    --------------------------------------------------------------------------------
    Problem
    --------------------------------------------------------------------------------
    On clicking on an executable jar file an error is displayed 'Could not find the main class. Program will exit!'
    This error only occurs with some versions of Java for Windows before Java 1.4.  
    Resolution
    --------------------------------------------------------------------------------
    Open a folder. Select Tools from the menu bar.
    Select Folder options...
    Select the File Types tab
    Select the Jar entry in the Extensions column of the table shown.
    The details for handleing jar files will be shown at the bottom of the window.
    Click Advanced
    Select the open row in the Actions table
    Click Edit
    In the field Application used to perform action: you will see the entry [path]/bin/javaw "%1"
    where [path] is the path to your java installation. The path may be in quotes e.g. "C:/Program Files/jre/bin/javaw" "%1"
    Insert the text -jar in front of the text "%1" followed by a space.
    The example would now read "C:/Program Files/jre/bin/javaw"[]-jar[]"%1" where [] is a space.Click on OK to apply the change 
      

  6.   

    jar要放在web服务的容器里才能执行.
      

  7.   

    首先确保你的环境变量设置正确。按楼上的方法试试。不行的话,建个批处理文件。 
    新建一个文本文件,假设取名为my.txt。 
    顶行输入:java -jar youApp.jar保存,把my.txt改名为my.bat。
    OK,点击my.bat文件就可以运行你的java程序。
      

  8.   

    换个新版本的jdk1.5,我遇到过.