为啥jar包没法运行。

fxxxgxxx 2004-01-11 12:04:38
我已经安装了jsdk1.4和java运行环境1.3,也已经将.jar文件映射到了java运行环境目录下javaw.exe上
现有一个jar包,ibm官方网站上下的,不会有问题,但双击运行后提示:can't find the main class,programe not exit!
请教为什么?
谢谢
...全文
67 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
staminalim 2004-01-11
  • 打赏
  • 举报
回复
你用winrar打开看看,在META-INF目录下的MANIFEST.MF文件,看看有没有指定Main-Class
fxxxgxxx 2004-01-11
  • 打赏
  • 举报
回复
这个jar包是个安装程序,应该有main class的。
我用java -jar 就能顺利运行。
louisqiang 2004-01-11
  • 打赏
  • 举报
回复
jar文件中要声明Main-Class才行。
rongrongGsr 2004-01-11
  • 打赏
  • 举报
回复
主程序里面没有main class,你可以用winrar打开jar文件,看一下里面的META-INF目录下的MENIFEST.MF文件里面有没有类似Main-Class: Main的行,有的话就是可以运行的。
whyxx 2004-01-11
  • 打赏
  • 举报
回复
并不是所有的jar包都能运行,他的主程序没有main函数的话就不能运行
goodsong 2004-01-11
  • 打赏
  • 举报
回复
If you're sure the package can run from the command line, I think addtional information should be posted here to solve this problem
goodsong 2004-01-11
  • 打赏
  • 举报
回复
not all jar packages contain the main class
so you can't run them
for example:
you can package your classes into tow jars,but only one contain the main entry class,the other one will not runnalbe form the command line
qlampskyface 2004-01-11
  • 打赏
  • 举报
回复
mark

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧