Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile multiple class files in Java on LINUX shell?

Hello I am on campus trying to compile a simple binary tree program .. our campus only has shell and I am using Linux over eclipse..

I have 2 class files in my current directory bintree.java and treetest.java

javac bintree.java treetest.java

this code creates multiple classes but what is my next step? ive searched everywhere theres not a lot of info on java Linux shell. thank you

like image 224
user3349184 Avatar asked Feb 25 '14 01:02

user3349184


1 Answers

If all of the java files you need to compile are in your directory you can

javac *.java 

And then

java NameOfClassWithMainMethod

Otherwise if you want to learn to work without an IDE I would suggest learning to use Maven or Gradle. They will abstract away a lot of the tedium of compiling a project, and if become a pro dev you'll need to know at least Maven anyway.

like image 80
jeremyjjbrown Avatar answered Nov 14 '22 23:11

jeremyjjbrown