Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run multiple java files at once?

Tags:

cloud

hadoop

I have multiple .java files for my hadoop project. How do I execute them without using eclipse?

PS: I use the default ubuntu terminal

like image 908
user1291453 Avatar asked Sep 04 '26 08:09

user1291453


1 Answers

You can use javac *.java to compile all the files in the current working directory. As for executing them, use java filename
Where the filename does NOT have the .class at the end. IE, you have MyProgram.java which compiles into MyProgram.class you would type: java MyProgram

You want the run the main class of your project btw (slightly vague, but it might be the only one with a main method).

like image 157
Youssef G. Avatar answered Sep 07 '26 06:09

Youssef G.



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!