你的清单文件里设置Main-Class设置错了,有包名的要加上包名。
如:你的主类是org.hello.MainFrame,就设置为这个样子!
如:你的主类是org.hello.MainFrame,就设置为这个样子!
解决方案 »
- java编程题目 求解。。。。。
- 结果和我想的不一样.具体说和书上写的不一样
- java聊天程序的问题..请大侠们帮帮小弟...
- 真的很急的一个问题,关于jvm中的运行对象
- 如何取到当前url页面的全部内容,在线等...
- 请GG赐教.MM痛哭流涕中~ 55555555555~~,
- JFrame和Frame是什么关系,有什么区别
- class的访问控制???
- 請教開發三層架构程序的編程語言(功能強大,使用方便)?
- java 能设置.properties 某个的key=value放在文件的最顶端???
- 还是昨天的代码,问一个新的问题!
- 问大家一个问题:jbuilder写完的项目后怎么让客户运行啊?还有为什么好多公司都不用jbuilder
没有社错的,我下载别人的产品.jar都是这个问题,比如大名鼎鼎的robocode-setup.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
新建一个文本文件,假设取名为my.txt。
顶行输入:java -jar youApp.jar保存,把my.txt改名为my.bat。
OK,点击my.bat文件就可以运行你的java程序。