Ja.NET Standard Edition 5.0

Tools Documentation

Tools Main

bam - build assembly module

Usage: bam {cu} [avgfmkw] [assembly_filename] [manifest_filename] [key_filename] [java_classfile_dir] [-C dir] input_assembly_files �

Description

The bam tool is used to merge multiple assembly files produced by the javac compiler into a single .NET assembly file. The syntax for using the bam tool is similar to the syntax for the Java jar tool. At a minimum, you must specify either a c or u option together with two or more input_assembly_files. All other options and parameters will take on default values as described below.

Ja.NET SE Related Options

Example:

C:\myDir> bam c *.class

The above example creates an assembly with the name myDir.dll in the C:\MyDir directory, overwriting myDir.dll if it already exists.

Example:

C:\mydir> bam cf myAssembly.dll *.class

This will combine the entire set of .class files generated by the javac compiler in the C:\mydir into an assembly named myAssembly.dll.It will overwrite it if it already exists. If you used the u option, instead of c, bam would update the existing assembly if it already existed, rather than overwriting it. When using any of the fmkw options, you need to be aware that each of those options are paired with an additional required option on the command line. It is important to understand that the order in which you specify the fmkw options further dictates the order in which additional parameters are specified on the command line.

Example:

C:\mydir> bam cfk myAssembly.dll myKey.snk *.class

Since the f option precedes the k option, you must specify the [assembly_filename] parameter first, followed by the [key_filename] parameter. If the f and k options had been reversed the filename parameters would also need to be reversed.  The command line should look like this:

C:\mydir> bam ckf myKey.snk myAssembly.dll *.class

Example:

C:\myDir> bam cfw myAssembly.dll .\classes .\netclasses

The above example creates a new assembly with the name myAssembly.dll by combining all assemblies found as a result of recursively searching all subdirectories starting in C:\myDir\netclasses for assemblies with the .class filename extension. Also, for each assembly it finds in C:\myDir\netclasses, it searches for a corresponding Java .class file with the same name in the directory C:\myDir\classes.  If found, it updates the .class file to include the Ja.NET SE assembly module class file attribute. If a corresponding Java .class file is not found, it will create a new one with the attribute.