Ask coding questions

← Back to all posts
Multiple classes in different files repl is ignoring everything apart from my main.java file
pjmccabe

I'm only new using this website and I'm trying to do my lab work for college which is to run classes from different files together and when I try to run any other file other than the main it just outputs the main it compiled the others giving me errors which now say is fixed but is still only giving me the output of the main. I know they must be in the same folder and I couldn't get Main.java into it so I left it blank and made another main in the folder which works fine but will not access the other files.

Voters
itsmichaelyu
pjmccabe
Comments
hotnewtop
SixBeeps

Unfortunately, Repl.it always uses Main.java as the entry class. Just call the other classes' main methods directly from the Main class'.

pjmccabe

@SixBeeps thank you very much for the reply im not sure if that'll be allowed I might have to try "and fail" to download java againXD

SixBeeps

@pjmccabe Hehe, alrighty then. If you'd like, I might also be able to help you while installing Java.

pjmccabe

@SixBeeps that would be great I cant get the paths to work I just keep getting the error javac is not recognized as an internal or external command