无法找到或加载主类 - 如何修复请 [英] Could not find or load main class - how to fix please

查看:98
本文介绍了无法找到或加载主类 - 如何修复请的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家!美好的一天。



我的java安装遇到了麻烦。

当我尝试运行运行java的.bat文件时程序有错误。



它说无法找到或加载主类。





请帮帮我!谢谢!



我的尝试:



1.我已经将jdk bin文件夹的位置添加到环境变量的路径中但仍然有错误。



2.我也可以在cmdjava -version上运行命令,它已经在使用该命令了。这意味着已经安装了java。

Hi experts! Good day.

I am having a trouble on my java installation.
When I try to run a .bat file that runs a java program is having an error.

It says "could not find or load main class".


Help me please! Thank you!

What I have tried:

1. I already added the location of jdk bin folder to the path of environment variable but still having an error.

2. I can also run the command on cmd "java -version" and it's working already with that command. That means java was already installed.

推荐答案

错误是因为Java无法找到您尝试运行的代码的主类。检查您是否使用了正确的路径和类文件的名称。
The error is because Java could not find the main class of the code you are trying to run. Check that you are using the correct path and name to the class file.


这篇关于无法找到或加载主类 - 如何修复请的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆