[英]How to solve could not find or load mainclass error?
I am getting this error if I add new component to my frame if I remove it then it works.如果我将新组件添加到我的框架中,如果我删除它,我会收到此错误,然后它就可以工作了。
I done this troubleshooting我完成了这个故障排除
(1)deleting index folder and restart computer and netbeans (1)删除index文件夹,重启电脑和netbeans
(2)increased heap size in conf file (2)增加conf文件中的堆大小
(3)set environment variable in windows system as (3)在windows系统中设置环境变量为
:-User variable name = CLASSPATH
:-variable value = C:\Program Files (x86)\Java\jdk1.8.0_40\bin;C:\Program Files (x86)\Java\jre1.8.0_40\bin;.
:-System variable name :-Path
:-System Variable value:-C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Java\jdk1.8.0_40\bin;C:\Program Files (x86)\Java\jre1.8.0_40\bin
but the problem persists但问题仍然存在
if i add new component(radiobutton,label,scrollpane) it gives me this error:如果我添加新组件(radiobutton、label、scrollpane),它会给我这个错误:
you can try Clean and build your project, if it doesn't work, you can check the posts from您可以尝试 Clean 并构建您的项目,如果它不起作用,您可以查看来自
Netbeans - Error: Could not find or load main class , Netbeans - 错误:无法找到或加载主类,
Error: Could not find or load main class (netbeans and java) or 错误:无法找到或加载主类(netbeans 和 java)或
What does "Could not find or load main class" mean? “找不到或无法加载主类”是什么意思?
With Java 11 you can start a class from the terminal with使用 Java 11,您可以从终端启动一个类
java classname.java
java类名.java
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.