Run from command line, Wrong Name error

后端 未结 6 1883
栀梦
栀梦 2020-12-22 07:58

I want to run a Java project from the command line which I start using a batch file, but I get the wrong name error.

The directory setup:

  • srcMVC
      <
6条回答
  •  既然无缘
    2020-12-22 08:35

    Java run time (in your case the java.exe command), takes the class file name that containst the main() method as input. I guess you should be invoking it as "java bin\main" assuming there is a main.class which has a public static void main (String[]) method defined.

    Note: General practice is to capitalize the first literal of any class name.

提交回复
热议问题