bcj [ options ] {file.java}
bcj compiles the selected .java file and any of its imported files that do not have .class files. bcj compiles the specified .java file, whether or not its .class file is outdated. (An "outdated" .class file is one that was not generated by compiling the current version of its .java source file.) bcj also compiles any directly imported .java files that do not have .class files. Imported .java files that already have .class files will not be recompiled, even if their .class files are outdated; after using the bcj command, some imported classes might still have outdated .class files.
bcj does not check dependencies between files.
To see the syntax and list of options at the command line, enter the bcj
command with no arguments.
You might need to run setvars.bat
to set the environment variables for the command line, so the required classes are found.
See also:
Building Applications with JBuilder, "Compiling Java programs:" Smart Dependencies Checking
Building Applications with JBuilder, "Compiling Java programs:" Compiling from the command line
Building Applications with JBuilder, "Command line tools:" Setting environment variables for command-line tools
Building Applications with JBuilder: bmj command-line compiler
For example:
If no CLASSPATH is defined, the default classpath is:bcj -classpath c:\testclasses\test3;c:\mydir;c:\jbuilder\myclasses tester.java
%JAVAHOME%\classes;%JAVAHOME%\lib\classes.zip
If JAVAHOME is not defined, the default classpath is:
\java\classes;\java\lib\classes.zip
For example, the following statement:
causes the class files for the classes defined in thebcj -d c:\jbuilder\myclasses tester.java
tester.java
source file to be saved in the directory c:\jbuilder\myclasses\test\test3
directory, assuming that tester.java contains the following package statement: test.test3
Files are read from the class path and written to the destination directory. The destination directory can be part of the class path. The default destination matches the package structure in the source files and starts from the root directory of the source.
For example, the following statement:
compiles tester.java and any directly imported .java files that do not have .class files. Characters in all source files are interpreted as the PC and Windows character set for Japanese.bcj -encoding SJIS tester.java