为什么“错误:无法找到或加载主类addstudent.AddStudent”正在显示 [英] Why "Error: Could not find or load main class addstudent.AddStudent" is showing
问题描述
我正在使用NetBeans IDE开发项目。我是javafx的新手。我在名为addstudent的包中创建了一个AddStudent类。当我运行该类时,我得到错误:无法找到或加载主类addstudent.AddStudent。为什么会出现此错误?怎么解决?
I am developing a project using NetBeans IDE. I am new to javafx. I created a class "AddStudent" in a package named "addstudent". When I ran the class, I got "Error: Could not find or load main class addstudent.AddStudent". Why this error is showing ? How can it solved ?
推荐答案
我正在运行你的代码,它运行正常。我做了什么
I'm running your code and it works fine. What I did
-
创建新 - > JavaFx主类 - > AdStudent - >复制/粘贴代码
Created New -> JavaFx Main Class -> AdStudent -> Copy/Pasted your code
右键单击Project - > Properties - > Run - > Browse Application Class - > Select class addstudent.AddStudent
Right click on Project -> Properties -> Run -> Browse Application Class -> Select class addstudent.AddStudent
清理和构建
我觉得前两个对你没问题。您可能只需要清理和构建。
I have a feeling the first 2 are fine for you. You may just need to Clean and Build.
这篇关于为什么“错误:无法找到或加载主类addstudent.AddStudent”正在显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!