how to compile multiple file in java using single command

Some times we need to compile multiple files with a single command. Though most programmer use IDe but sometimes we have command lines only.

If your case is like that then you can use any of the following methods-

1. Specify all the files manually

javac File1.java File2.java File3.java

2. Compile all .java file in the directory

javac *.java

This will compile all the Java files in the current directory.

Comments

Popular posts from this blog

Ternary operator and Nested Ternary operator

How to pass argument in main function of java program using command line argument