cannot run a simple java code

前端 未结 5 1684
离开以前
离开以前 2021-01-22 11:45

I have downloaded a java developers kit for my 64bit windows 7, wrote down my code in the notepad, though the code is compiling from the command prompt and creating a .class fil

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-22 12:23

    It is quite possible after compiling your code you would be writing java filename.java. Because this sought of exception occurs then.

    After compiling your program using javac filename.java use the command to start your interpreter java filename.

    As you enter this command java interpreter automatically starts interpreting filename.class.

    commands :

    javac filename.java   // to start compiling
    java filename         // to start interpreting
    

提交回复
热议问题