win7/xp 双击执行jar包出现:could not find the main class
来源:互联网 发布:多乐炸金花作弊软件 编辑:程序博客网 时间:2024/06/06 01:48
转自:http://blog.csdn.net/hyx1990/article/details/7550994
今天同学问我双击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的方法
- 双击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解决方法详解
- windows 双击执行jar包出现:could not find the main class
- fatjar导出的jar文件双击执行时提示could not find the main class
- 双击jar文件出现Could not find main class的解决办法
- eclipse打的jar包无法执行,报错could not find main class
- java 执行JAR文件总报 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简易解决办法
- jar文件Could not find the main class解决办法
- Eclipse中执行Ant脚本出现Could not find the main class的问题及解
- blog/时间设置
- EL表达式
- HDOJ2037
- HK_C_U\Software\Microsoft\Windows\ShellNoRoam\MUICache键值作用
- ADO的Command对象
- win7/xp 双击执行jar包出现:could not find the main class
- 了解驱动程序和操作系统基础
- 嵌入式linux启动信息完全注释
- 为驱动程序编写人员提供的其他资源
- java学习笔记-线程和进程-黑马
- 简明 Vim 练级攻略
- BackgroundWorker的使用例子-下载文件
- 排序算法稳定性
- 铃声问题记录