Could not find or load main class Java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Could not find or load main class Java

hello everyone, of course it is inappropriate to ask such a question here, but I want to start learning to program. In general, I downloaded everything for programming, the JDK, the development environment, set everything up, but I have one problem that I can’t understand, please help me:Could not find or load main class Java

27th Sep 2022, 3:28 PM
Akridem
Akridem - avatar
16 Answers
27th Sep 2022, 5:36 PM
Jayakrishna 🇮🇳
+ 1
Your file name should be same as class name
27th Sep 2022, 3:29 PM
A͢J
A͢J - avatar
+ 1
Yes, I know, but I still get the error
27th Sep 2022, 3:30 PM
Akridem
Akridem - avatar
+ 1
Write your code in notepad and save with .java extension like Abc.java Then open cmd Write javac Abc.java Then press enter Now see what happens.
27th Sep 2022, 3:34 PM
A͢J
A͢J - avatar
+ 1
Akridem And your question is not inappropriate. It is okay to ask such type of questions.
27th Sep 2022, 3:35 PM
A͢J
A͢J - avatar
+ 1
Akridem That's not enough information to identify the problem.. where are you trying this? What are the steps you followed after installing jdk.. Is it Successfully installed? The link has a video which will give you a sample for setup .. can you provide output screen shot? Try to uninstall and reinstall , then set path. Open terminal and select current directory of where you saved program .. May be now you are opening .class file, output showing..
28th Sep 2022, 2:04 PM
Jayakrishna 🇮🇳
0
I entered my code in notepad and saved it as: Abc.java. Then I went to cmd and wrote as you wrote and I got: javac: file not found: abc.Java. Usage: javac <options> <source files> use -help for a list of possible options
27th Sep 2022, 3:43 PM
Akridem
Akridem - avatar
0
Did you set the class path of JDK., environment variables.?
27th Sep 2022, 4:05 PM
Jayakrishna 🇮🇳
0
Akridem If you have saved file with Abc.java then abc.java should not come in error message Lowercase and uppercase character also matters. so class name should be 'Abc' and file name should be 'Abc.java'
27th Sep 2022, 4:14 PM
A͢J
A͢J - avatar
0
Probably not, because this is my first time in this, maybe this will fix my situation
27th Sep 2022, 5:04 PM
Akridem
Akridem - avatar
0
How to set Jdk path
27th Sep 2022, 5:04 PM
Akridem
Akridem - avatar
0
an error is coming out now: "javac" �� ���� ����७��� ��� ���譥� ��������, �ᯮ��塞�� �ணࠬ��� ��� ������ 䠩���.
28th Sep 2022, 1:24 PM
Akridem
Akridem - avatar
0
This error comes out when I compile the code. I did everything as in the link. I will try to reinstall JDK, maybe it will work
28th Sep 2022, 2:23 PM
Akridem
Akridem - avatar
0
Help me please i dont know how to create personal details with java use
29th Sep 2022, 3:39 AM
Jenevah Catampungan
Jenevah Catampungan - avatar
0
Jenevah Catampungan You have to learn Java not JavaScript
29th Sep 2022, 5:15 AM
A͢J
A͢J - avatar