How do you compiling a source code in java?

Java

1 answer

Answer

1077797

2026-04-30 08:51

+ Follow

Java
Java

The Javac command is used to invoke Java's compiler and compile a Java source file.

A typical invocation of the Javac command would look like below:

Javac [options] [source files]

Both the [options] and the [source files] are optional parts of the command, and both allow multiple entries. The following are both legal Javac commands:

Javac -help

Javac ClassName.Java OneMoreClassName.Java

The first invocation doesn't compile any files, but prints a summary of valid options. The second invocation passes the compiler two .Java files to compile (ClassName.Java and OneMoreClassName.Java). Whenever you specify multiple options and/or files they should be separated by spaces.

This command would create the .class files that would be require to run the Java progam.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.