This is a feature of JBuilder Professional and Enterprise.
bcj [ options ] {file.java}
bcj compiles the selected .java file and any files specified on the command line. 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.) 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 use the -classpath option or set the CLASSPATH
environment variable for the command line, so the required classes are found.
See also:
"Smart Dependencies Checking"
"Compiling from the command line"
"Setting the CLASSPATH environment variable for command-line tools" in "Using the command-line tools"
"Setting the classpath" in the Java Tools documentation
"bmj command-line make"
Note: Directories listed in paths are separated by colons on the UNIX platform and by semicolons on the Windows platform. The following examples represent the UNIX platform.
path
CLASSPATH
environment variable. You should always include the outpath at the beginning of the path. The classpath is also used to search for sources if no sourcepath is specified.
For example:
bcj -classpath jbproject/testing/classes/test3: jbproject/project1/classes tester.java
directory
For example, the following statement:
bcj -d jbproject/project1/classes tester.javacauses the class files for the classes defined in the
tester.java
source file to be saved in the directory jbproject/project1/classes/test/test3
, assuming that tester.java
contains the following package statement: package 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.
name
codepage
name) to control how the compiler interprets characters beyond the ASCII character set. The default is to use the default native-encoding converter for the platform. For more information, see the topic called "Specifying a native encoding for the compiler" in the "Internationalizing programs with JBuilder" chapter of Building Applications with JBuilder.
For example, the following statement:
bcj -encoding EUC_JP tester.javacompiles
tester.java
. All source files are interpreted as being encoded in the EUC_JP character set, which is the character set typically used for Japanese UNIX environments. You can specify any encoding that is supported by the Java 2 platform. A list of the valid encodings is available at http://java.sun.com/j2se/1.3/docs/tooldocs/tools.html#intl.
path
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 compile tester.java
, which contains the package statement package test.test3;
and is located in jbproject/project1/src/test/test3
, you must set the source path to jbproject/project1/src
and not to jbproject/project1/src/test/test3
.
You can then type the following:
bcj -sourcepath jbproject/project1/src jbproject/project1/src/test/test3/tester.java -d jbproject/project1/classes
version
bootclasspath
directories
option
java
launcher called by bcj. For example, -J-Xms48m sets the startup memory to 48 megabytes. It is a common convention for -J to pass options to the underlying VM executing applications written in Java.
Note that CLASSPATH
, -classpath, -bootclasspath, and -extdirs do not specify the classes used to run
bcj. If you do need to do this,
use the -J option to pass through options to the bcj launcher.