FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
In JDK 8, we can provide the implementation of method with the help of static and default keyword. We can't run interface before JDK 8 but now we can provide main method implementation inside interface and we can run it... I have implemented main method inside interface and run the program. It was working fine.. but I comment in main method and try to run program I got error "Error: Main method not found in class org.vc.TestI, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application"
Beauce we are running interface so there should be interface instead of class in error message.
Error message should be "Error: Main method not found in interface org.vc.TestI, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Error: Main method not found in interface org.vc.TestI, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
ACTUAL -
Error: Main method not found in class org.vc.TestI, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package org.vc;
public interface TestI {
/* public static void main(String[] args) {
System.out.println("Hi...");
getMsg();
}*/
public static void getMsg(){
System.out.println("method");
}
void getData();
}
---------- END SOURCE ----------
A DESCRIPTION OF THE PROBLEM :
In JDK 8, we can provide the implementation of method with the help of static and default keyword. We can't run interface before JDK 8 but now we can provide main method implementation inside interface and we can run it... I have implemented main method inside interface and run the program. It was working fine.. but I comment in main method and try to run program I got error "Error: Main method not found in class org.vc.TestI, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application"
Beauce we are running interface so there should be interface instead of class in error message.
Error message should be "Error: Main method not found in interface org.vc.TestI, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Error: Main method not found in interface org.vc.TestI, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
ACTUAL -
Error: Main method not found in class org.vc.TestI, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package org.vc;
public interface TestI {
/* public static void main(String[] args) {
System.out.println("Hi...");
getMsg();
}*/
public static void getMsg(){
System.out.println("method");
}
void getData();
}
---------- END SOURCE ----------
- relates to
-
JDK-8174027 error message should adapt to the corresponding top level element
- Closed