Closed fabgio closed 4 months ago
I got a runtime error:" symbolic reference class is not accessible: class Main, from class org.codehaus.mojo.exec.ExecJavaMojo (unnamed module @6326c6cb)", The bytecode is final synthetic class Main {
// compiled from: Main.java // access flags 0x19 public final static INNERCLASS java/lang/invoke/MethodHandles$Lookup java/lang/invoke/MethodHandles Lookup
// access flags 0x0
@lacostej I tried to give access to the unnamed mainClass as such:
(ExecJavaMojo.java)
Method mainMethod = bootClass.getDeclaredMethod("main");
mainMethod.setAccessible(true);
but I got this "java.lang.Exception: The specified mainClass doesn't contain a main method with appropriate signature." Any tip? Thanks
I found out the unnamed main class is package private so it seems impossibile to access it
Given the JEP below:
https://openjdk.org/jeps/463
I wish to add support for unnamed classes and instance main method such as:
void main() { System.out.println("Hello, World!"); }
I declared only a main method and a class named Main.java:
public static void main(String...args) {
} ``
``