双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
来源:互联网 发布:侠盗无双0.4下载 软件 编辑:程序博客网 时间:2024/06/06 03:27
could not find the main class win7/xp 双击执行jar包出现:could not find the main class .
今天同学问我双击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文件, 问题完美解决.
你可能感兴趣的文章:
Java代码优化编程详解
如何在eclipse中使用XYLayout布局?在此介绍如何把XYLayout导入到eclipse
讲解如何在jbuilder2006的项目中配置jdk路径
- 双击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
- SQLite模糊查找(like)
- VIM 高阶
- CLR线程池的工作者线程
- 写在研究生入学之前
- typedef和#define的区别
- 双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
- 经典递归应用--汉诺塔(C#语言版)
- Using Images as Buttons on Windows Phone 7
- 苹果开发者成惊弓之鸟:一封邮件引发的风波
- 第n+2周任务控制
- 混合使用Objective-C,C++和Objective-C++
- Ajax的常用技巧(6)---实现web页面局部动态刷新
- win32汇编和8086汇编的一点区别
- android手机root后的安全问题 (一)