Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling Java program with multiple classes on Linux

Tags:

java

So far I have been able to compile my Java programs in Linux using javac command in Terminal, but soon I'll need to compile a program that has two or three classes in it along with main and I'm not sure how this will work.

Can I still use javac command for this?

like image 352
Nick Avatar asked Jun 30 '26 07:06

Nick


1 Answers

Yes, just do javac *.java (if all your classes are in the default package).

like image 116
Keith Randall Avatar answered Jul 02 '26 19:07

Keith Randall



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!