双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
来源:互联网 发布:流水账记账软件 编辑:程序博客网 时间:2024/05/29 19:38
本文转载自:http://www.cnblogs.com/langtianya/archive/2012/09/05/2671267.html
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的实际路径
打开注册表(cmd-regedit)注册表项的路径为:
\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"
注意-jar左右两边跟引号之间是有空格的,否者会出现could not create the java virtual machine错误
然后依然用上述的javaw.exe关联jar文件, 问题完美解决.
- 双击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解决方法详解
- 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的方法
- win7下设置jar包关联方法/could not create the java virtual machine 解决方法
- HDP出现Could not create the Java Virtual Machine解决方法
- windows 双击执行jar包出现:could not find the main class
- could not create the java virtual machine
- "could not create the java virtual machine"
- "could not create the java virtual machine
- Could not create the Java virtual machine
- Could not create the Java Virtual Machine
- could not create the java virtual machine
- java virtual machine launcher Could not find the main class. Program will exit
- Java中继承Thread和实现Runnable这两种创建线程有何区别
- 关于OpenMips
- Scan 算法
- 徐汉彬:亿级Web系统搭建——单机到分布式集群
- zigbee zcl规范及其协议栈实现1
- 双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
- onload和ready的不同
- 注意:firstChild和lastChild
- MTK 6260功能机蓝牙介绍
- Python 实现最长公共子序列LCS
- nmake的常用命令
- Cocos2d-x Studio与IDE的使用
- HTML,CSS和JAVASCRIPT入门经典 笔记(一)
- iOS:数据转json对象