I'm working on the exercises in "Think Java" Chapter 15 "Conway's Game of Life". I'm a little confused by the way the provided code is set up. The program runs by typing "java Conway.java" in the console and does everything I want including the modifications from the exercises. But, as I'm using replit, I'd rather just hit the big green "Run" button. This button automatically runs "java Main.java" as far as I can tell. Looking for a fast way to point the main() method in Main.java to "java Conway.java" has lead me to suggestions that seem far too involved for what I want to do, from introducing and additional library to run console commands, to basically re-writing most of the program so "Conway.java" is replaced with Main.java in every possible location.
At last I got it to work by just calling:
class Main {
public static void main(String[] args) {
Conway.main(args); }
}
But, also read that this is "bad practice" -- I guess I'm wondering why make a program that dodges the fun green "run" button? Why is it "bad practice" to do the above?
I also wanted to automate javac in the main file, but I've given up on this. It would be nice to specify what I needed to compile, but I'm concerned that I don't have enough time to fully understand the libraries suggested for running such commands.