jar包无法运行——could not find the main class...(java -jar *.jar可以运行,jar包不可以打开的解决方法)
2012-03-21 13:56
721 查看
could not find the main class...(java -jar *.jar可以运行,jar包不可以打开的解决方法)
1.首先确定你已安装正确版本的jdk,并以正确的指定jdk的环境变量 2.确认C:\Windows\System32\目录下不存在java.exe、javaw.exe等文件 如果存在删除之,或移到别的地方(非环境变量的目录内)。 3.此时运行java -jar *.jar 看是否可以运行 4.如上述不可以运行,请检查1、2步 [其实双击不能运行和上面的没有关系,只是希望大家能正确配置JDK的环境变量] 5.java -jar *.jar 可以运行的话,而直接双击不可运行jar文件 控制面板->文件夹选项->文件类型->JAR 下面的<高级>按纽 <操作>下面选 OPEN , 点右边的<编辑>,在应用程序文本框中输入jar执行的程序 我的如下:"C:\Program Files\Java\jre1.6.0_04\bin\javaw.exe" -jar "%1" %* 此处建议先浏览选择你的javaw的程序的路径,然后拷贝后面的运行参数[ -jar "%1" %*],注意不能缺少空格,如若提示找不到程序,建议修改引号 如改成:"C:\Program Files\Java\jre1.6.0_04\bin\javaw.exe -jar "%1" %* 或:"C:\Program Files\Java\jre1.6.0_04\bin\javaw.exe -jar %1" %* 如若找不到【高级】按钮,可以看看是不是存在【还原】按钮,点击【还原】后,试试看是否可以直接运行jar包,如若不行,在修改之。 |
相关文章推荐
- 运行jar文件时,出现“could not find the main class”的解决方法
- 双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法
- 双击jar包出现:could not find the main class .和could not create the java virtual machine.win7/xp解决方法详解
- 解决运行java application时提示Could not find the main class.Program will exit.问题
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法
- 解决Win7/XP中双击jar文件出现could not find the main class的方法
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法 .
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法
- 双击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解决方法详解
- 在centos中运行java命令时出现Error: Could not find or load main class XXX问题的解决方法
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法 .
- maven项目,多个依赖,打成一个可执行jar包,可根据profiles进行打包,出现的Could not find or load main class的解决方法。
- jar文件Could not find the main class解决办法
- java打jar包的异常一:could not find the main class,java.lang.UnsupportedClassVersionError: Bad version numb
- runnable jar 不能在win7打开,显示错误:Could not find the main class. Program will exit.
- Java执行main方法,异常为:could not find the main class.program will exit