1. Error record
function
class Student1 {
}
Groovy code will report an error;
Error message:
groovy.lang.GroovyRuntimeException: This script or class could not be run.
It should either:
- have a main method,
- be a JUnit test or extend GroovyTestCase,
- implement the Runnable interface,
- or be compatible with a registered script runner. Known runners:
* <none>
2. Problem analysis
Only groovy code that meets the following requirements can run:
With main function
test case, used as JUnit test or extended GroovyTestCase
Thread related and implements the runnable interface
It is compatible with the registered script running program
Groovy code in other cases cannot be run;
Read More:
- Idea startup project: main class not found or cannot be loaded
- Unable to find or load master class org.codehaus.groovy.grails.cli.support
- IntelliJ idea class is normal, but error is marked in red and cannot be found
- IntelliJ idea error: package not found or symbol not found
- Error: the main class usertest could not be found or loaded
- Problems encountered after Maven installation or upgrade: could not find or load main class org.codehaus.plexus .class…..
- WCF-HTTP Error 404.17 – Not Found, The requested content appears to be script and will not be served…
- The main class could not be found or loaded when springboot started
- IntelliJ idea community community integrated Tomcat or jetty tutorial
- Idea error: unable to find or load the main class
- [solved] error: module not specified (IntelliJ idea)
- When IntelliJ idea is programmed, 1. Black thick line or black cursor appears; 2. The solution of carriage return unable to wrap. (practical recommendation method 2)
- IntelliJ idea code did not report an error, compilation failed
- [error] error handling of IntelliJ idea
- 2021 / 06 / 28 error – because the script PowerShell is not allowed to run on this system
- IntelliJ idea error: error: Java does not support release 5
- The main class com.hp.springbootapplication cannot be found or loaded
- IntelliJ idea startup error: error statuslogger log4j2 could not find a logging implementation
- Error in installing torch vision or pilot on Linux or Jetson nano: the headers or library files could not be found for JPEG
- IntelliJ idea automatically generates serialVersionUID