bmj [options] rootClasses
bmj looks for dependency files on the classpath. If you specify a set of sources, some or all of those sources might not be recompiled. For example, the class files might be determined to be up to date, if they have been saved but not edited since the last compile. You can force recompilation using the -rebuild option.
To check a set (or "graph") of interdependent classes, it is sufficient to call bmj on the root class (or multiple root classes, if one is not under the other). You can specify root classes using class names, package names, names of sources that declare classes, or a combination.
To see the syntax and list of options at the command line, enter the bmj
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: bcj command-line compiler
Options
For example:
If no CLASSPATH is defined, the default classpath is:bmj -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 thebmj -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
The updated dependency file test.test3.dependency will also be saved in that directory.
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 for class files matches the package structure in the source files and starts from the root directory of the source. The default destination for dependency files matches the package structure and starts in the current directory.
If a warning is displayed when compiling, indicating that some deprecated APIs were used, you can turn this option on to see all deprecated APIs.
For example, the following statement:
does a Make and dependency checking starting with root classes declared in tester.java. Characters in all source files are interpreted as the PC and Windows character set for Japanese.bmj -encoding SJIS tester.java
With this option, a given branch of the checking process halts when it reaches a package marked "stable"; it does not look for unstable packages imported by the stable packages. Therefore, with this option, you might need to specify a greater number of modules to compile. Suppose unstable package A uses stable package B, which uses unstable package C. If you want to skip rechecking the stable package B, then you need to specify compiling package C in addition to package A; otherwise, package C will not be checked (unless A depends directly on C).
By default, bmj checks packages marked "stable" as well as packages marked "unstable", to determine whether they and their imported classes need to be recompiled. For more information, see the topic called Selectively compiling stable packages in "Compiling Java programs."
This option is especially useful for working with a library of classes with no source available, when some of the class files are not consistent, but not used.
See also:
Building Applications with JBuilder, "Compiling Java programs:" The Make command
Building Applications with JBuilder, "Compiling Java programs:" Selectively compiling stable packages
See also:
Building Applications with JBuilder, "Compiling Java programs:" The Rebuild command
set
command.
If no source path is specified and if no SOURCEPATH environment variable is set, the classpath is used to find the sources.
Similar to the classpath, the sourcepath must point to the root of the package directory tree, and not directly to the directory of the sources. For example, to make tester.java
, which contains the package statement test.test3
and is located in d:\mydir\test\test3
, you must set the source path to d:\mydir
and not to d:\mydir\test\test3
. From any current directory, you can then type the following:
bmj d:\mydir\test\test3\tester.java -d d:\myclasses
{[-s] {source.java} | -p {package} | -c {class}}
For example, the following statement:
is the same asbmj -s borland\samples\tutorial\dataset\CalcField.java
bmj borland\samples\tutorial\dataset\CalcField.java
If you list some packages with the -p option before listing sources, then you need to specify the -s option. If you list sources before packages and classes, the -s is assumed, and is not necessary.
For example, the following statement:
makes all classes of the borland.samples.tutorial.dataset package, and all imported classes.bmj -p borland.samples.tutorial.dataset
For example, the following statement:
makes the class CalcField of package borland.samples.tutorial.dataset and all imported classes.bmj -c borland.samples.tutorial.dataset.CalcField
As another example, the following statement:
makes the source file tester.java, packages package1 and package2, and all the java files in thebmj tester.java -p package1 package2 -s mydir\*.java
mydir\
directory.
Note that the first source name (tester.java) comes before the -p (package) option, so does not need to explicitly specify the -s option, because -s is assumed. If you want to specify another source file name after the -p option is specified, you have to explicitly specify the -s option.