javaw和* Could not find the main class. Program will exit!
2007-09-03 15:45
429 查看
今天部署工程在调用javaw命令时出个怪异常, Could not find the main class. Program will exit!
文件夹myProject下有三个jar文件: a.jar,b.jar,c.jar和一个批处理文件: s.bat
主函数在 a.jar文件里.
在批处理文件里输入了如下命令: java -cp *; com.pro.Main
程序运行正常!!!
但将java改成javaw然后点击批处理,就弹出一个对话框提示错误:Could not find the main class. Program will exit!
在网上搜索一些常见的解决方法都不行,.mf文件也改了!错误一样!
后来发现输入命令javaw -cp a.jar com.pro.Main程序可以启动!当然没有加载其他的依赖包,程序本生会有异常!
于是把问题锁定到命令格式上!怀疑javaw -cp 后的jar路径里不支持*通配符.
最后把批处理文件改成: javaw -cp a.jar;b.jar;c.jar com.pro.Main
启动程序,一切正常!
文件夹myProject下有三个jar文件: a.jar,b.jar,c.jar和一个批处理文件: s.bat
主函数在 a.jar文件里.
在批处理文件里输入了如下命令: java -cp *; com.pro.Main
程序运行正常!!!
但将java改成javaw然后点击批处理,就弹出一个对话框提示错误:Could not find the main class. Program will exit!
在网上搜索一些常见的解决方法都不行,.mf文件也改了!错误一样!
后来发现输入命令javaw -cp a.jar com.pro.Main程序可以启动!当然没有加载其他的依赖包,程序本生会有异常!
于是把问题锁定到命令格式上!怀疑javaw -cp 后的jar路径里不支持*通配符.
最后把批处理文件改成: javaw -cp a.jar;b.jar;c.jar com.pro.Main
启动程序,一切正常!
相关文章推荐
- (报错)could not find the main class, Program will exit(已解决)
- could not find the main class, Program will exit(已解决)
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法
- @(报错)could not find the main class, Program will exit(已解决)
- junit:could not find the main class Program will exit
- java程序运行时出现问题:Could not find the main class: test_jena. Program will exit.
- Could not find the main class.Program will exit.
- runnable jar 不能在win7打开,显示错误:Could not find the main class. Program will exit.
- Could not find the main class. Program will exit.
- could not find the main class. Program will exit.
- Debian配置JAVA环境报错之Could not find the main class: HelloWorld. Program will exit.
- 错误处理:could not find the main class, Program will exit
- could not find the main class .program will exit的解决方案
- Could not find the main class: org.apache.catalina.startup.Boostrap. Program will exit
- Could not find the main class ***.Program will exit
- 错误处理:could not find the main class, Program will exit
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法 .
- jdk版本不同造成问题解决could not find the main class, Program will exit(2)
- Could not find the main class: org.elasticsearch.bootstrap.Elasticsearch. Program will exit.
- Java执行main方法,异常为:could not find the main class.program will exit