Gradle - Could not find or load main class

前端 未结 13 852
星月不相逢
星月不相逢 2020-11-29 06:51

I\'m trying to run a very simple project using Gradle and running into the following error when using the gradlew run command:

could not find or l

13条回答
  •  广开言路
    2020-11-29 07:34

    When I had this error, it was because I didn't have my class in a package. Put your HelloWorld.java file in a "package" folder. You may have to create a new package folder:

    Right click on the hello folder and select "New" > "Package". Then give it a name (e.g: com.example) and move your HelloWorld.java class into the package.

提交回复
热议问题