Home > Back-end >  A novice for help! With CMD to write a simple helloworld, compilation is successful, the Java interp
A novice for help! With CMD to write a simple helloworld, compilation is successful, the Java interp

Time:10-28

This is a notepad source code: public class HelloWord {
Public static void main (String [] args) {
System. The out. Print (" HelloWord ");
}
}
This is the result of the console
C: \ Users \ liang14658fox & gt; The desktop CD

C: \ Users \ liang14658fox \ Desktop> Javac HelloWord. Java

C: \ Users \ liang14658fox \ Desktop> Java Hello
Error: Could not find or load a main class Hello
Under Caused by: Java. Lang. ClassNotFoundException: Hello!

C: \ Users \ liang14658fox \ Desktop>


For why mistake??

CodePudding user response:

Java HelloWord, your class name is wrong, send subtopic

CodePudding user response:

Hello, you lose,,,,,,

CodePudding user response:

Sorry upstairs and two brothers, I dialed the wrong number here, later changed or wrong, my teacher remote assistance also run failed, but to send the code to the teacher there can run perfect, oneself use the eclipse can also????

CodePudding user response:

Is fine for your JDK environment variables, oneself also can use the CMD running yesterday, not today??

CodePudding user response:

Why input HelloWork, Hello? See my below in figure

CodePudding user response:

Why input HelloWord, Hello? Input number HelloWord. When you compile the Java, you perform input is Hello, so not careful, see the following figure I
  • Related