Hello, I'll start to use this this next course and I'd like to know if there is a way to work around the detection of the main class in Java assignments when they are attached.
So, the following code would work in the text box:
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
But if it is attached in a file named Main.java, it cannot find the prog class, so you need to rename the file to prog.java and change the class name to prog (which goes against Java naming convention).
Is there a way to either:
a) Fix this, so it works with attachments.
b) Force the name of the main class (either always the same, like Main, or exercise-dependent, like Ex123)
Thank you!
EDIT:
Ok, so... I think b) is possible.
I've checked the source code. And apparently one can define the sourcefilename param in the advanced customization area, as this:
{"sourcefilename": "Main.java"}
Also, per the source code, I see that the main class name guessing is only performed for the code in the text box, and not for the code in the attachments, so a) is not done.