cmd下运行java文件时报错找不到或无法加载主类

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/fhf2424045058/article/details/84869822

写了一个hello的java文件:

public class hello {
	public static void main(String[] args) {
		System.out.println("----------------------------hello-----------------------");
	}
}

运行结果:
先javac hello.java 进行编译
在运行,java hello.class 时报错找不到或无法加载主类
百度后找到解决办法,运行时 不能加后缀class

猜你喜欢

转载自blog.csdn.net/fhf2424045058/article/details/84869822