Change the Name of Main.java
I'm using Replit Teams for Education to make assignments for students, and evaluate them using Unit Tests. I'd like them to be able to rename the Main.java file to something more meaningful for our applications. Is this possible? The students are sometimes inexperienced, so I'd hate for them to have to go in and make changes through the command line. I'd rather it be delivered to them with the name already changed.
You must be getting an error when you change the file name right?
This is because replit is configured to run a file named
Main.java in the shell. So if you change the name to something else, replit can't find
Main.java, so it throws an error.
To fix this, you have to create a
.replit file, and put in this command:
run = "<run command here>" language = "<repl language>" # optional
This will run the desired filename, no matter what the name is of the file. You can even attach multiple language files in one repl.
Hope I was helpful!!!