could not find the main class win7/xp 双击执行jar包出现:could not find the main class
来源:互联网 发布:查域名注册商 编辑:程序博客网 时间:2024/06/06 00:25
今天同学问我双击jar包在有的机子上可以运行,但在有的机子上确没法运行,我就我遇到的问题和解决办法拿出来分享:
1.elipse打jar包一般有两种:一种是普通的jar file,另外一种是Runnable jar file;要想可执行当然选择第二种了
2.确人java -jar xxx.jar 在控制台或制作的bat文件中是否正常运行,如果不能正常运行说明jar包有问题;问题一般是没有
指定main方法入口,具体的方法是修改jar包内目录META-INF下的MANIFEST.MF文件,看是否有Main-Class属性,并且
对应的类shifoulujing、书写等正确;
3.由于机子上装了压缩软件,jar包被压缩软件所关联,导致双击jar包无法运行,解决办法当然是改变打开方式:
将默认打开方式改为jre/bin目录下的javaw.exe
4.由于文件打开类型配置的问题,导致双击jar包出现找不到main函数,该类问题不管是xp,还是Win7比较统一
的解决办法是修改关联程序的注册表,修改方法如下
注意:"C:\Program Files\Java\jre6\bin\javaw.exe"应为你所装的javaw.exe的实际路径
注册表项的路径为:
\HKEY_CLASSES_ROOT\Aplications\javaw.exe\shell\open\command
在此路径下有一默认键值, 不正常的情况下, 键值是:"C:\Program Files\Java\jre6\bin\javaw.exe" "%1"
将键值改为"C:\Program Files\Java\jre6\bin\javaw.exe" -jar "%1"
然后依然用上述的javaw.exe关联jar文件, 问题完美解决.
- could not find the main class win7/xp 双击执行jar包出现:could not find the main class
- could not find the main class win7/xp 双击执行jar包出现:could not find the main class
- win7/xp 双击执行jar包出现:could not find the main class
- win7/xp 双击执行jar包出现:could not find the main class
- 解决Win7/XP中双击jar文件出现could not find the main class的方法
- windows 双击执行jar包出现:could not find the main class
- 双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
- 双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
- 双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
- fatjar导出的jar文件双击执行时提示could not find the main class
- Could not find the main class:
- Could not find the main class
- Eclipse could not find the main class
- jar出错 could not find the main class
- jar文件Could not find the main class简易解决办法
- jar文件Could not find the main class解决办法
- myeclipse出现Could not find the main class原因分析
- java 执行JAR文件总报 Could not find the main class
- CPSR/SPSR 详解
- UITableView,UITableViewCell,UIPickerView,UISearchBar
- iOS程序lifecycle
- java获取db元数据
- 随机生成十个不重复的整数
- could not find the main class win7/xp 双击执行jar包出现:could not find the main class
- Flex两页面间的传值问题总结 .
- Linux中svn的相关操作
- 2440 存储系统及I/O空间详解
- 16个桌面Linux用户必须要知道的Shell命令
- java调用oracle的存储过程
- 第十二周任务3
- Linux中设置环境变量
- JDBC连接数据库大全