0

Exampleprogram not workong

when I pressed javac example program.java in commandpromt it automatically went to next line after that I pressed java exampleprogram as they said in tutorial and it came a error "could not find main class exampleprogram " this was the error

5th Apr 2017, 12:32 PM
Naredla Ajay (Channel A)
Naredla Ajay (Channel A) - avatar
8 ответов
5th Apr 2017, 12:36 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 2
Share your code
5th Apr 2017, 12:38 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 2
Code is ok, check the filename. It's letter case has to be same as of the class name. This may be a problem that I am able figure out.
5th Apr 2017, 1:13 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 2
Then add path of jvm and compiler into Windows path variable. 1. Right Click on My Computer 2. Select Properties command 3. On left pane of open Window, choose Advance System Settings 4. Click Environment Variables button 5. In the Edit System Variable window, specify the value of the PATH environment variable. 6. Close all dialog box. 7. Open Command prompt window, and run your java code. Hope this may help🤗
5th Apr 2017, 1:26 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
0
I need to know why its not working
5th Apr 2017, 12:37 PM
Naredla Ajay (Channel A)
Naredla Ajay (Channel A) - avatar
0
public class ExampleProgram { public static void main(String[ ] args) { System.out.println("Hello World"); } }
5th Apr 2017, 1:05 PM
Naredla Ajay (Channel A)
Naredla Ajay (Channel A) - avatar
0
its correct I saved it on desktop and when I press in command promt everything goes well but at last when I press java ExampleProgram it says the file not found
5th Apr 2017, 1:16 PM
Naredla Ajay (Channel A)
Naredla Ajay (Channel A) - avatar
0
I set the path after installing java it was done before after setting path I started exampleprogram and it came file not found
7th Apr 2017, 6:37 AM
Naredla Ajay (Channel A)
Naredla Ajay (Channel A) - avatar