Java之中could not find the main class
来源:互联网 发布:如何找淘宝小二 编辑:程序博客网 时间:2024/06/11 02:23
在Eclipse之中编写代码,然后可以正常运行,但是如果使用CMD命令提示符之后总是出现could not find the main class的错误,让人很是捉急,先后查阅了一些资料,比如这样关于web的,此处无用,还有说是我的环境配置错误的,但是在我测试之后发现都没有问题,最后终于发现,出现这个问题是因为,在eclipse代码之中每一个class文件,第一句都有一个是package的引述,如此处的 package udpTest这句话,所以问题出现了,通过在当前的包所在的文件夹下面,找得到源代码,但是在编译之后,却让第一句话把本来应该执行的东西给搞乱了方向,所以,才会出现could not find the main class的错误,修改的方法就是,在命令行中执行的时候,去掉package这句话,好蛋疼的说,每次都这样的话!!!!所以希望求解更方便的方法!!!!!!!!!!!!!
错误的情况如下:没有这个类?UdpServer_Test_123, 错误 的名字udpTest/UdpServer_Test_123
而如果,将它修改一下,如下图,仍然是没有这个类?
但是,还没有找到一个更好的方法,希望各位能够给出一点建议和解决方法。
关于Java环境变量的配置可以参见以下两篇文章环境变量配置,环境变量的理解
0 0
- Java之中could not find the main class
- Java中Could not find the main class.program will
- [Java Beginner] Problem to "Could not find the main class"
- Could not find the main class:
- Could not find the main class
- Eclipse could not find the main class
- Java执行main方法,异常为:could not find the main class.program will exit
- Could not find main class
- Could not find main class
- 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...
- Could not find the main class. Program will exit
- jar出错 could not find the main class
- Could not find the main class.Program will exit.
- Could not find the main class. Program will exit.
- Could not find the main class.progrm will exit
- junit:could not find the main class Program will exit
- vs2010的opencv2.4.11的配置
- hdu 5492 Find a path DP
- 【HNOI2006】【BZOJ1192】鬼谷子的钱袋
- monkey测试3-测试结果分析
- 视觉机器学习20讲 K-means
- Java之中could not find the main class
- HTTP的GET和POST
- 在后端是PHP程序的情况下,保持前端Javascript和PHP之间传值的统一编码可以使用以下函数进行处理:
- 设计模式的讲解
- 全民工作狂的碎碎念2015-09-29
- ImageView的setBackgroundResource与setImageResource区别
- HPC技术趋势:HPDA、深度学习、软件定义和机柜即HPC
- MFC模拟360悬浮窗加速球窗口
- 百分比